diff options
author | Moshe Zadka <moshez@math.huji.ac.il> | 2000-11-30 12:31:03 (GMT) |
---|---|---|
committer | Moshe Zadka <moshez@math.huji.ac.il> | 2000-11-30 12:31:03 (GMT) |
commit | 1a62750eda22dcef1976f4a3dbaa886039cd2f92 (patch) | |
tree | 291193bd5c8e1c6cb83b1087cb2b935bf82e4a8c /Lib | |
parent | 827bb9fb3c6c3889c046404df171a0b8f383eb23 (diff) | |
download | cpython-1a62750eda22dcef1976f4a3dbaa886039cd2f92.zip cpython-1a62750eda22dcef1976f4a3dbaa886039cd2f92.tar.gz cpython-1a62750eda22dcef1976f4a3dbaa886039cd2f92.tar.bz2 |
Added .first{item,value,key}() to dictionaries.
Complete with docos and tests.
OKed by Guido.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_types.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index eec9e2d..06b001a 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -265,3 +265,9 @@ if d['key'][0] <> 3: d.setdefault('key', []).append(4) if len(d['key']) <> 2: raise TestFailed, 'present {} setdefault, w/ 2nd arg' +if d.keys()[0] != d.firstkey(): + raise TestFailed, 'first key is not first in keys' +if d.values()[0] != d.firstvalue(): + raise TestFailed, 'first value is not first in values' +if d.items()[0] != d.firstitem(): + raise TestFailed, 'first item is not first in items' |