diff options
Diffstat (limited to 'Lib/test/test_extcall.py')
-rw-r--r-- | Lib/test/test_extcall.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 7ed0e2e119..f1fff0a5ec 100644 --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -243,6 +243,24 @@ TypeError if te dictionary is not empty ... TypeError: id() takes no keyword arguments +A corner case of keyword dictionary items being deleted during +the function call setup. See <http://bugs.python.org/issue2016>. + + >>> class Name(str): + ... def __eq__(self, other): + ... try: + ... del x[self] + ... except KeyError: + ... pass + ... return str.__eq__(self, other) + ... def __hash__(self): + ... return str.__hash__(self) + + >>> x = {Name("a"):1, Name("b"):2} + >>> def f(a, b): + ... print(a,b) + >>> f(**x) + 1 2 """ from test import support |