[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

Raymond Hettinger report at bugs.python.org
Wed Jun 25 08:48:47 CEST 2014


Raymond Hettinger added the comment:

> there's still no way to represent repeat's signature in Python
There is a way using *args and **kwds but that isn't any fun (just like range() or min() in that regard).

Right now, repeat() does what it is supposed to do.  It may currently be inconvenient for the argument clinic, but changing repeat() in way that no one currently needs smacks of having the tail wag the dog ;-)

What I would like to see in the future is better support for optional arguments in
PyArg_ParseTupleAndKeywords.  Right now, "O|n:repeat" precludes us from using None or some sentinel object to mean the same as the-argument-was-omitted.   To put a None default value in now, we would have to do tricks with "O|O" and then manually write the "|n" validation, type conversion, and associated error messages.

----------

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


More information about the Python-bugs-list mailing list