classification
Title: accept keyword arguments on all base type methods and builtins
Type: enhancement Stage:
Components: Versions: Python 3.3, Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: gregory.p.smith, meatballhat
Priority: normal Keywords:

Created on 2010-05-13 19:10 by gregory.p.smith, last changed 2010-05-14 01:45 by meatballhat.

Messages (1)
msg105652 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2010-05-13 19:10
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.
History
Date User Action Args
2010-05-14 01:45:31meatballhatsetnosy: + meatballhat
2010-05-13 19:10:53gregory.p.smithcreate