mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Bug #1486663: don't reject keyword arguments for subclasses of builtin
types.
This commit is contained in:
parent
aef4c6bc00
commit
b84c13792d
9 changed files with 62 additions and 16 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue