[issue20341] Argument Clinic: add "nullable ints"

Raymond Hettinger report at bugs.python.org
Fri Aug 1 02:55:35 CEST 2014


Raymond Hettinger added the comment:

FWIW, I agree with Antoine that Nullable Int is a misnomer.

Also, I don't buy into this mission to change signatures for optional ints into int-or-none.   In particular, itertools.repeat() is fine as-is.  Optional int APIs have been around for a long time, they work fine, and they really don't need to be changed.  AFAICT, there is no real issue here that warrants changes to existing APIs.


>>> s = [10, 20, 30]
>>> s.pop(None)
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    s.pop(None)
TypeError: 'NoneType' object cannot be interpreted as an integer


>>> int('42', None)
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    int('42', None)
TypeError: 'NoneType' object cannot be interpreted as an integer

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20341>
_______________________________________


More information about the Python-bugs-list mailing list