diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_types.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 9cfc680..1e982d1 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -558,6 +558,13 @@ if type(dictlike.fromkeys('a')) is not dictlike: raise TestFailed, 'dictsubclass.fromkeys created wrong type' if type(dictlike().fromkeys('a')) is not dictlike: raise TestFailed, 'dictsubclass.fromkeys created wrong type' +from UserDict import UserDict +class mydict(dict): + def __new__(cls, *args, **kwargs): + return UserDict(*args, **kwargs) +try: mydict.fromkeys('a b c'.split()) +except TypeError: pass +else: raise TestFailed, 'dict.fromkeys() failed to detect non-dict class.' # dict.copy() d = {1:1, 2:2, 3:3} if d.copy() != {1:1, 2:2, 3:3}: raise TestFailed, 'dict copy' |