[issue40670] supplying an empty string to timeit causes an IndentationError

2021-05-18 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 557b9a52edc4445cec293f2cc2c268c4f564adcf by Serhiy Storchaka in branch 'master': bpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358) https://github.com/python/cpython/commit/557b9a52edc4445cec293f2cc2c268c4f564adcf

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21396 pull_request: https://github.com/python/cpython/pull/22358 ___ Python tracker ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Irit Katriel
Change by Irit Katriel : -- assignee: -> docs@python components: +Documentation nosy: +docs@python type: -> behavior ___ Python tracker ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-06-12 Thread Roundup Robot
Change by Roundup Robot : -- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +20024 pull_request: https://github.com/python/cpython/pull/20830 ___ Python tracker ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I intended to say that the current behavior would be less puzzling if the doc were changed as I suggest. I think that a doc change would be sufficient. -- ___ Python tracker

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-23 Thread Florian Dahlitz
Florian Dahlitz added the comment: @terry.reedy sorry if I misunderstood you, but it seems to me that you agree with the proposed changes? -- ___ Python tracker ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Let a wcs be a string consisting of only whitespace and comments. compile(wcs, '', 'exec') treats wcs the same as 'pass'. Hence, a file with only whitespace and comments is the same as 'pass'. compile(wcs, '', 'single'), for whatever reason, raises SyntaxError:

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-22 Thread Rahul Kumaresan
Change by Rahul Kumaresan : -- nosy: -rahul-kumi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-21 Thread Florian Dahlitz
Florian Dahlitz added the comment: I see your point and agree with you. However, IMHO the CLI and the direct function call should behave the same way to not confuse users. The opened PR ensures that. -- ___ Python tracker

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Accepting an empty string in CLI is just an artifact of the implementation. There was no intention to support it. It will fail if pass a space: ./python -m timeit ' ' or two empty arguments: IndentationError: ./python -m timeit '' '' I do not

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-21 Thread Florian Dahlitz
Change by Florian Dahlitz : -- keywords: +patch pull_requests: +19560 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20286 ___ Python tracker ___

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-21 Thread Florian Dahlitz
Florian Dahlitz added the comment: Calling timeit from command-line with the empty string defaults to 'pass'. I suggest to adopt this behaviour for calling timeit.timeit in the REPL as @edison.abahurire already suggested. I would be happy to submit a PR for it. --

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-21 Thread Florian Dahlitz
Change by Florian Dahlitz : -- nosy: +DahlitzFlorian ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-20 Thread Edison Abahurire
Edison Abahurire added the comment: Yes, This is unexpected In the first case: Supplying an empty string can also mean no code has been supplied. So it could be better treated as 'pass'. In the second case: Error messages are meant to inform you of what you have done wrong so that you fix

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-18 Thread Rahul Kumaresan
Change by Rahul Kumaresan : -- nosy: +rahul-kumi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-18 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Is this different than what you would expect? Supplying garbage to timeit will result in an error: >>> from timeit import timeit >>> timeit('weofinwofinwe') Traceback (most recent call last): File "", line 1, in File

[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-18 Thread Edison Abahurire
New submission from Edison Abahurire : The Error can be evidenced below: ``` >>> >>> import timeit >>> >>> timeit.timeit('', number=1) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/timeit.py", line 232, in timeit return Timer(stmt, setup, timer,