classification
Title: method with special keyword-only argument gives error
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, flox, ncoghlan, python-dev
Priority: normal Keywords:

Created on 2012-04-17 21:28 by flox, last changed 2012-04-17 23:54 by python-dev. This issue is now closed.

Messages (3)
msg158568 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2012-04-17 21:28
This is probably a bug.


>>> class A:
...   def f(self, __a=42):
...     pass
... 
>>> A().f()
>>> class A:
...   def f(self, *, __a=42):
...     pass
... 
>>> A().f()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() needs keyword-only argument _A__a
msg158578 - (view) Author: Roundup Robot (python-dev) Date: 2012-04-17 23:54
New changeset f8540b8d076c by Benjamin Peterson in branch '3.2':
mangle keyword-only argname when loading defaults (closes #14607)
http://hg.python.org/cpython/rev/f8540b8d076c
msg158579 - (view) Author: Roundup Robot (python-dev) Date: 2012-04-17 23:54
New changeset 22844ddce57b by Benjamin Peterson in branch 'default':
merge 3.2 (#14607)
http://hg.python.org/cpython/rev/22844ddce57b
History
Date User Action Args
2012-04-17 23:54:41python-devsetmessages: + msg158579
2012-04-17 23:54:30python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg158578

resolution: fixed
stage: resolved
2012-04-17 23:36:42pitrousetnosy: + ncoghlan, benjamin.peterson
2012-04-17 21:28:15floxcreate