[issue19145] Inconsistent behaviour in itertools.repeat when using negative times
Larry Hastings
report at bugs.python.org
Wed Jun 25 09:17:15 CEST 2014
Larry Hastings added the comment:
> There is a way using *args and **kwds but that isn't any fun
That's why, earlier, I said a "sensible" signature. Every function *could* get the signature "(*args, **kwargs)" but this imparts no useful semantic information.
> What I would like to see in the future is better support
> for optional arguments in PyArg_ParseTupleAndKeyword
It sounds to me like you're proposing adding "nullable int" support to PyArg_ParseTuple*. I'm not going to; I see Argument Clinic as the way forward, and I'm adding it there instead.
In general I'd rather see work go into AC than into PyArg_ParseTuple*. I think PyArg_ParseTuple* is already too complicated, and using AC gives the function a signature for free. My hope is to increase the value proposition of AC so much that everyone agrees with me and we deprecate (but don't remove!) PyArg_ParseTuple*. :D
> changing repeat() in way that no one currently needs smacks of having
> the tail wag the dog
I concede that nobody (probably) needs a workable default value for the times argument. But I suggest that giving functions sensible signatures is a worthy goal in its own right, and that the "times=None" semantics will get us there in a reasonable, backwards-compatible way.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19145>
_______________________________________
More information about the Python-bugs-list
mailing list