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 terry.reedy
Recipients georg.brandl, python-dev, serhiy.storchaka, terry.reedy
Date 2015-03-24.21:28:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This is a nice catch of a subtle bug and a nice fix.  I verified that replacing 'self' with '*args' does not simply shift the problem from 'self' to 'args'.

>>> class C:
	def test(*args, **kwargs):
		print(args, kwargs )
>>> c = C()
>>> c.test(1, args=2, kwargs=3, self=4)
(<__main__.C object at 0x00000000035FE128>, 1) {'args': 2, 'kwargs': 3, 'self': 4}

While the * and ** names are, like parameter names, local names given in the signature header, they are not counted as parameter names in the code object .co_argcount or .co_kwonlyargcount attributes that are used along with co_varnames in the name-argument matching process.
Date User Action Args
2015-03-24 21:28:27terry.reedysetrecipients: + terry.reedy, georg.brandl, python-dev, serhiy.storchaka
2015-03-24 21:28:27terry.reedysetmessageid: <>
2015-03-24 21:28:27terry.reedylinkissue23671 messages
2015-03-24 21:28:27terry.reedycreate