mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
SF #1486663 -- Allow keyword args in subclasses of set() and frozenset().
This commit is contained in:
parent
a398e2d059
commit
9fdfadb06e
2 changed files with 13 additions and 2 deletions
|
@ -468,6 +468,16 @@ class SetSubclass(set):
|
|||
class TestSetSubclass(TestSet):
|
||||
thetype = SetSubclass
|
||||
|
||||
class SetSubclassWithKeywordArgs(set):
|
||||
def __init__(self, iterable=[], newarg=None):
|
||||
set.__init__(self, iterable)
|
||||
|
||||
class TestSetSubclassWithKeywordArgs(TestSet):
|
||||
|
||||
def test_keywords_in_subclass(self):
|
||||
'SF bug #1486663 -- this used to erroneously raise a TypeError'
|
||||
SetSubclassWithKeywordArgs(newarg=1)
|
||||
|
||||
class TestFrozenSet(TestJointOps):
|
||||
thetype = frozenset
|
||||
|
||||
|
@ -1450,6 +1460,7 @@ def test_main(verbose=None):
|
|||
test_classes = (
|
||||
TestSet,
|
||||
TestSetSubclass,
|
||||
TestSetSubclassWithKeywordArgs,
|
||||
TestFrozenSet,
|
||||
TestFrozenSetSubclass,
|
||||
TestSetOfSets,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue