diff options
author | Georg Brandl <georg@python.org> | 2007-01-21 10:28:56 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-01-21 10:28:56 +0000 |
commit | 8e932e7d6886544a1b0f2503382d87e3875eb9fe (patch) | |
tree | fb068c18fbd6198e68b4ad4b5a0c8c7d1a389845 /Lib/test/test_array.py | |
parent | 9d8ccf7df2f9516ecf8e92dac67c299a930580b6 (diff) | |
download | cpython-git-8e932e7d6886544a1b0f2503382d87e3875eb9fe.tar.gz |
Bug #1486663: don't reject keyword arguments for subclasses of builtin
types.
(backport from rev. 53509)
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-x | Lib/test/test_array.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 06f13cd2b7..63e7f4ebb6 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -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): |