[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-25 Thread Dan Rose
Dan Rose added the comment: Oops you are right. These enter uninterruptible loops too. They are exceptional situations and should do the expected thing - throw exceptions as well. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-25 Thread Dan Rose
Dan Rose added the comment: The general problem with infinite iterators is indeed a bigger issue and its resolution would probably resolve this issue too. With the examples you gave at least the user can ctrl-c to interrupt. Entering an infinite, *uninterruptible* loop is a consequence so

[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-25 Thread Dan Rose
Dan Rose added the comment: Reopening. While my behavioral expectation may be wrong, the current behavior is inappropriate. It would make more sense for count to have a `__contains__` method which raises a TypeError. -- resolution: rejected -> status: closed ->

[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-24 Thread Dan Rose
New submission from Dan Rose : Checking membership in `itertools.count()` will either return True in linear time or enter an infinite loop that cannot be terminated with Ctrl-c. This ``` import itertools 1 in itertools.count(0,2) ``` It is expected that the above code will use an efficient

[issue36045] builtins.help function is not much help with async functions

2019-02-19 Thread Dan Rose
Dan Rose added the comment: Note to future self: whatever solution should also play nice with functools.partial -- ___ Python tracker <https://bugs.python.org/issue36

[issue36045] builtins.help function is not much help with async functions

2019-02-19 Thread Dan Rose
Dan Rose added the comment: Thanks for the suggestion, Raymond. I was toying with the idea of a PR, but wasn’t sure what the resolution should be, and it’s a rather subtle decision for my first contribution. It seems to me that this might be an oversight in PEP-0484, and the purest

[issue36045] builtins.help function is not much help with async functions

2019-02-19 Thread Dan Rose
Change by Dan Rose : -- title: Help function is not much help with async functions -> builtins.help function is not much help with async functions ___ Python tracker <https://bugs.python.org/issu

[issue36045] Help function is not much help with async functions

2019-02-19 Thread Dan Rose
New submission from Dan Rose : It is very important when using a callable to know whether it is async or not. It is expected that `builtins.help` function should provide the information needed to properly use the function, but it omits whether it is an async function or not. ``` import

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
Dan Rose added the comment: Another curious case: a = (500,500); b = (500,500) print(a[0] is b[0]) # True print(a[0] is b[1]) # False print(a[1] is b[0]) # False print(a[1] is b[1]) # True -- ___ Python tracker <ht

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
New submission from Dan Rose : In the Python 3.7.0 interpreter, the following evaluates to False. In 3.6.4, it was True: c,d = 500,500 c is d This seems to be because, in some cases, Python 3.7 fails to intern integers inside tuples: a = (500,500) print(a[0] is a[1