Edison Abahurire <abahedis...@outlook.com> 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 it. I think raising an Indentation error is far from what a user who is calling that method would be expecting, it does not help them at-all. In the third case: Supplying an empty string to timeit directly in bash ```python -m timeit '' ``` raises no such error. so we could say that fixing this will align the behavior in the two ways the function is run to be the same. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40670> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com