[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

Tal Einat report at bugs.python.org
Fri Jan 24 23:05:15 CET 2014


Tal Einat added the comment:

In general, that sounds like a reasonable suggestion to me. A quick search shows that most classes that call _PyArg_NoKeywords check the type first. I think we should strive for uniformity in this respect, so I'm +1 for your suggestion.

I do see some classes which accept only positional arguments but where that check isn't in place. Examples:

* itertools.tee just calls PyArg_ParseTuple without checking _PyArg_NoKeywords (is this a bug?) (this is fairly common, I think)

* range always calls _PyArg_NoKeywords, without checking the type (is this a bug?) (this is rare)

----------

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


More information about the Python-bugs-list mailing list