[issue23988] keyworded argument count is wrong

2015-04-17 Thread Albert Zeyer

New submission from Albert Zeyer:

Code:

class C(object):
def __init__(self, a, b=2, c=3):
pass

class D(C):
def __init__(self, d, **kwargs):
super(D, self).__init__(**kwargs)

class E(D):
def __init__(self, **kwargs):
super(E, self).__init__(**kwargs)

E(d=42, b=0, c=0)

You get the funny message:

TypeError: __init__() takes at least 2 arguments (3 given)

--
components: Interpreter Core
messages: 241335
nosy: Albert.Zeyer
priority: normal
severity: normal
status: open
title: keyworded argument count is wrong
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23988
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23988] keyworded argument count is wrong

2015-04-17 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is a well-known shortcoming of 2.x function signature errors. The 
situation is much improved in 3.x:

TypeError: __init__() missing 1 required positional argument: 'a'

--
nosy: +benjamin.peterson
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23988
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com