[Python-checkins] r70013 - peps/trunk/pep-0372.txt

raymond.hettinger python-checkins at python.org
Fri Feb 27 05:33:20 CET 2009


Author: raymond.hettinger
Date: Fri Feb 27 05:33:19 2009
New Revision: 70013
Log:
Indent code fragments.
Modified:
 peps/trunk/pep-0372.txt
Modified: peps/trunk/pep-0372.txt
==============================================================================
--- peps/trunk/pep-0372.txt	(original)
+++ peps/trunk/pep-0372.txt	Fri Feb 27 05:33:19 2009
@@ -37,11 +37,11 @@
 
 The following example shows the behavior for simple assignments:
 
->>> d = odict()
->>> d['parrot'] = 'dead'
->>> d['penguin'] = 'exploded'
->>> d.items()
-[('parrot', 'dead'), ('penguin', 'exploded')]
+ >>> d = odict()
+ >>> d['parrot'] = 'dead'
+ >>> d['penguin'] = 'exploded'
+ >>> d.items()
+ [('parrot', 'dead'), ('penguin', 'exploded')]
 
 That the ordering is preserved makes an odict useful for a couple of
 situations:
@@ -90,10 +90,10 @@
 well as mappings like a dict does. Unlike a regular dictionary,
 the insertion order is preserved.
 
->>> d = odict([('a', 'b'), ('c', 'd')])
->>> d.update({'foo': 'bar'})
->>> d
-collections.odict([('a', 'b'), ('c', 'd'), ('foo', 'bar')])
+ >>> d = odict([('a', 'b'), ('c', 'd')])
+ >>> d.update({'foo': 'bar'})
+ >>> d
+ collections.odict([('a', 'b'), ('c', 'd'), ('foo', 'bar')])
 
 If ordered dicts are updated from regular dicts, the ordering of new
 keys is of course undefined.
@@ -102,13 +102,13 @@
 ``items()`` return the values ordered by the time the key was
 first inserted:
 
->>> d['spam'] = 'eggs'
->>> d.keys()
-['a', 'c', 'foo', 'spam']
->>> d.values()
-['b', 'd', 'bar', 'eggs']
->>> d.items()
-[('a', 'b'), ('c', 'd'), ('foo', 'bar'), ('spam', 'eggs')]
+ >>> d['spam'] = 'eggs'
+ >>> d.keys()
+ ['a', 'c', 'foo', 'spam']
+ >>> d.values()
+ ['b', 'd', 'bar', 'eggs']
+ >>> d.items()
+ [('a', 'b'), ('c', 'd'), ('foo', 'bar'), ('spam', 'eggs')]
 
 New methods not available on dict:
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /