This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2016-04-21.19:23:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
itemgetter(), attrgetter() and methodcaller() objects require one argument. They raise TypeError if less or more than one positional argument is provided. But they totally ignore any keyword arguments.

>>> import operator
>>> f = operator.itemgetter(1)
>>> f('abc', spam=3)
>>> f = operator.attrgetter('index')
>>> f('abc', spam=3)
<built-in method index of str object at 0xb7172b20>
>>> f = operator.methodcaller('upper')
>>> f('abc', spam=3)

Proposed patch makes these objects raise TypeError if keyword arguments are provided.
Date User Action Args
2016-04-21 19:23:41serhiy.storchakasetrecipients: + serhiy.storchaka
2016-04-21 19:23:41serhiy.storchakasetmessageid: <>
2016-04-21 19:23:41serhiy.storchakalinkissue26822 messages
2016-04-21 19:23:41serhiy.storchakacreate