[issue8706] accept keyword arguments on all base type methods and builtins
Gregory P. Smith
report at bugs.python.org
Thu May 13 21:10:55 CEST 2010
New submission from Gregory P. Smith <greg at krypto.org>:
C Python has a real wart in that standard types and library functions that are implemented in C do not always accept keyword arguments:
>>> 'xxxxxx'.find('xx', 4)
4
>>> 'xxxxxx'.find('xx', start=4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: find() takes no keyword arguments
>>>
While other things do accept keywords:
sorted(s, key=bla)
We should clean this up. It is not well documented anywhere and I suspect other python implementations (haven't tested this) may accept keywords on these where C Python doesn't.
In string.find()'s case it looks like this is because it is an old style C method declaration that only gets an args tuple, no keyword args dict.
----------
messages: 105652
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: accept keyword arguments on all base type methods and builtins
type: feature request
versions: Python 3.2, Python 3.3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8706>
_______________________________________
More information about the Python-bugs-list
mailing list