[issue20341] Argument Clinic: add "nullable ints"

Larry Hastings report at bugs.python.org
Wed Jan 22 11:47:06 CET 2014


Larry Hastings added the comment:

Then you disagree with Guido, who says that optional integer arguments without a viable publishable default value should accept None to mean "use the default value":

https://mail.python.org/pipermail/python-dev/2014-January/131673.html
https://mail.python.org/pipermail/python-dev/2014-January/131711.html

There are a fair number of places where people are abusing positional
parameters because they can't specify a good default.  I plan to put a stop to that, but first I need to give them a viable alternative.

In the specific case of itertools.repeat, I'm going to talk to the maintainer about what he wants to do.  The current behavior is too magic for Python and iiuc Guido regards it as a bug.  My guess is a default of None, as the author was deliberately preventing you from passing in -1.  But we shall see.

----------

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


More information about the Python-bugs-list mailing list