diff options
author | Guido van Rossum <guido@python.org> | 2001-10-22 00:43:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-10-22 00:43:43 (GMT) |
commit | c8e5645f15054a87945d5f62dc23c6e49a394db5 (patch) | |
tree | 94172c8b5b197c564ba64789b81cd41334b996a9 /Lib/test | |
parent | d6bebce5e5a6e92b6949dd001d3d467a7aa1aaef (diff) | |
download | cpython-c8e5645f15054a87945d5f62dc23c6e49a394db5.zip cpython-c8e5645f15054a87945d5f62dc23c6e49a394db5.tar.gz cpython-c8e5645f15054a87945d5f62dc23c6e49a394db5.tar.bz2 |
Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_descr.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 962c1cc..d7a0644 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -2340,6 +2340,14 @@ def str_of_str_subclass(): vereq(capture.getvalue(), '41\n41\n') capture.close() +def kwdargs(): + if verbose: print "Testing keyword arguments to __init__, __call__..." + def f(a): return a + vereq(f.__call__(a=42), 42) + a = [] + list.__init__(a, sequence=[0, 1, 2]) + vereq(a, [0, 1, 2]) + def test_main(): class_docstrings() lists() @@ -2389,6 +2397,7 @@ def test_main(): subclasspropagation() buffer_inherit() str_of_str_subclass() + kwdargs() if verbose: print "All OK" if __name__ == "__main__": |