Issue 29661: Typo in the docstring of timeit.Timer.autorange (original) (raw)
Issue29661
Created on 2017-02-27 04:02 by Antony.Lee, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Pull Requests | |||
---|---|---|---|
URL | Status | Linked | Edit |
PR 331 | merged | xiang.zhang,2017-02-27 04:56 | |
PR 353 | merged | xiang.zhang,2017-02-28 03:11 |
| Messages (6) | | | | | | | | |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------- | | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| msg288619 - (view) | Author: Antony Lee (Antony.Lee) * | Date: 2017-02-27 04:02 | | | | | | |
| The docstring of timeit.Timer.autorange currently reads | Return the number of loops so that total time >= 0.2. | | Calls the timeit method with *number* set to successive powers of | ten (10, 100, 1000, ...) up to a maximum of one billion, until | the time taken is at least 0.2 second, or the maximum is reached. | Returns ``(number, time_taken)``. | | If *callback* is given and is not None, it will be called after | each trial with two arguments: ``callback(number, time_taken)``. Note the contradiction between the return values documented in the first and second paragraphs (the second one is correct). |
| msg288625 - (view) | Author: Raymond Hettinger (rhettinger) * | Date: 2017-02-27 09:44 | | | | | | |
| How about: Return the number of loops and time taken so that total time >= 0.2. Instead of: Return the number of loops so that total time >= 0.2. The proposed "calculate" instead of "return" isn't really correct. | | | | | | | | |
| msg288627 - (view) | Author: Xiang Zhang (xiang.zhang) *
| Date: 2017-02-27 09:50 | | | | | | |
| Of course that is okay. I didn't do what you propose since I thought it's somewhat superfluous, what is returned is mentioned below. I choose 'calculate' when I see 'Automatically determine how many times to call timeit()' in the documentation. | | | | | | | | |
| msg288688 - (view) | Author: Xiang Zhang (xiang.zhang) *
| Date: 2017-02-28 03:30 | | | | | | |
| Thanks Raymond! | | | | | | | | |
| msg290360 - (view) | Author: Xiang Zhang (xiang.zhang) *
| Date: 2017-03-24 23:35 | | | | | | |
| New changeset c4a786b8ad2a625594551ab3bc991a6831ba7688 by Xiang Zhang in branch '3.6': bpo-29661: fix contradiction in timeit.Timer.autorange's docstring (GH-331) (GH-353) https://github.com/python/cpython/commit/c4a786b8ad2a625594551ab3bc991a6831ba7688 | | | | | | | | |
| msg290361 - (view) | Author: Xiang Zhang (xiang.zhang) *
| Date: 2017-03-24 23:35 | | | | | | |
| New changeset ecf39bbc97adc0fb67654602e37d0d8313e9be9d by Xiang Zhang in branch 'master': bpo-29661: fix contradiction in timeit.Timer.autorange's docstring (GH-331) https://github.com/python/cpython/commit/ecf39bbc97adc0fb67654602e37d0d8313e9be9d | | | | | | | | |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:43 | admin | set | github: 73847 |
2017-03-24 23:35:51 | xiang.zhang | set | messages: + |
2017-03-24 23:35:39 | xiang.zhang | set | messages: + |
2017-02-28 03:30:15 | xiang.zhang | set | status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved |
2017-02-28 03:11:38 | xiang.zhang | set | pull_requests: + <pull%5Frequest302> |
2017-02-27 09:50:17 | xiang.zhang | set | messages: + |
2017-02-27 09:44:52 | rhettinger | set | nosy: + rhettingermessages: + |
2017-02-27 05:01:40 | xiang.zhang | set | assignee: xiang.zhangstage: patch reviewnosy: + xiang.zhangversions: + Python 3.7 |
2017-02-27 04:56:35 | xiang.zhang | set | pull_requests: + <pull%5Frequest291> |
2017-02-27 04:02:39 | Antony.Lee | set | nosy: - Antony.Lee -> (no value) |
2017-02-27 04:02:11 | Antony.Lee | create |