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

@ -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):