Bug #1486663: don't reject keyword arguments for subclasses of builtin

types.
This commit is contained in:
Georg Brandl 2007-01-21 10:28:43 +00:00
parent aef4c6bc00
commit b84c13792d
9 changed files with 62 additions and 16 deletions

View file

@ -486,6 +486,16 @@ class TestSubclass(unittest.TestCase):
d1 == d2 # not clear if this is supposed to be True or False,
# but it used to give a SystemError
class SubclassWithKwargs(deque):
def __init__(self, newarg=1):
deque.__init__(self)
class TestSubclassWithKwargs(unittest.TestCase):
def test_subclass_with_kwargs(self):
# SF bug #1486663 -- this used to erroneously raise a TypeError
SubclassWithKwargs(newarg=1)
#==============================================================================
libreftest = """
@ -599,6 +609,7 @@ def test_main(verbose=None):
TestBasic,
TestVariousIteratorArgs,
TestSubclass,
TestSubclassWithKwargs,
)
test_support.run_unittest(*test_classes)