mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +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
|
@ -12,6 +12,10 @@ from cPickle import loads, dumps
|
|||
class ArraySubclass(array.array):
|
||||
pass
|
||||
|
||||
class ArraySubclassWithKwargs(array.array):
|
||||
def __init__(self, typecode, newarg=None):
|
||||
array.array.__init__(typecode)
|
||||
|
||||
tests = [] # list to accumulate all tests
|
||||
typecodes = "cubBhHiIlLfd"
|
||||
|
||||
|
@ -683,6 +687,9 @@ class BaseTest(unittest.TestCase):
|
|||
b = array.array('B', range(64))
|
||||
self.assertEqual(rc, sys.getrefcount(10))
|
||||
|
||||
def test_subclass_with_kwargs(self):
|
||||
# SF bug #1486663 -- this used to erroneously raise a TypeError
|
||||
ArraySubclassWithKwargs('b', newarg=1)
|
||||
|
||||
|
||||
class StringTest(BaseTest):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue