[New-bugs-announce] [issue23988] keyworded argument count is wrong

Albert Zeyer report at bugs.python.org
Fri Apr 17 16:40:27 CEST 2015

New submission from Albert Zeyer:


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

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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list