summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userdict.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-11-22 00:07:40 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-11-22 00:07:40 (GMT)
commit54405456e5c2b76879472051c23e6c1c9f433beb (patch)
treeab0827e9b4532d0ad144d9e0033d451410eb41a3 /Lib/test/test_userdict.py
parentba2cf078d2bd8705f61afda7081522981674882e (diff)
downloadcpython-54405456e5c2b76879472051c23e6c1c9f433beb.zip
cpython-54405456e5c2b76879472051c23e6c1c9f433beb.tar.gz
cpython-54405456e5c2b76879472051c23e6c1c9f433beb.tar.bz2
Implement dict() style constructor.
Already supported dict() and dict(mapping). Now supports dict(itemsequence) and Just van Rossum's new syntax for dict(keywordargs). Also, added related unittests. The docs already promise dict-like behavior so no update is needed there.
Diffstat (limited to 'Lib/test/test_userdict.py')
-rw-r--r--Lib/test/test_userdict.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index a59419d..b561ac1 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -19,6 +19,9 @@ uu0 = UserDict(u0)
uu1 = UserDict(u1)
uu2 = UserDict(u2)
+verify(UserDict(one=1, two=2) == d2) # keyword arg constructor
+verify(UserDict([('one',1), ('two',2)]) == d2) # item sequence constructor
+
# Test __repr__
verify(str(u0) == str(d0))