[Python-checkins] cpython (2.7): Make indentation comply with our style guide and the rest of the file

eric.araujo python-checkins at python.org
Fri Jul 29 14:38:02 CEST 2011


http://hg.python.org/cpython/rev/140e4800110b
changeset:   71587:140e4800110b
branch:      2.7
user:        Éric Araujo <merwok at netwok.org>
date:        Tue Jul 26 16:54:24 2011 +0200
summary:
  Make indentation comply with our style guide and the rest of the file

files:
  Doc/tutorial/classes.rst |  28 ++++++++++++++--------------
  1 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -556,24 +556,24 @@
 Name mangling is helpful for letting subclasses override methods without
 breaking intraclass method calls.  For example::
 
-    class Mapping:
-        def __init__(self, iterable):
-            self.items_list = []
-            self.__update(iterable)
+   class Mapping:
+       def __init__(self, iterable):
+           self.items_list = []
+           self.__update(iterable)
 
-        def update(self, iterable):
-            for item in iterable:
-                self.items_list.append(item)
+       def update(self, iterable):
+           for item in iterable:
+               self.items_list.append(item)
 
-        __update = update   # private copy of original update() method
+       __update = update   # private copy of original update() method
 
-    class MappingSubclass(Mapping):
+   class MappingSubclass(Mapping):
 
-        def update(self, keys, values):
-            # provides new signature for update()
-            # but does not break __init__()
-            for item in zip(keys, values):
-                self.items_list.append(item)
+       def update(self, keys, values):
+           # provides new signature for update()
+           # but does not break __init__()
+           for item in zip(keys, values):
+               self.items_list.append(item)
 
 Note that the mangling rules are designed mostly to avoid accidents; it still is
 possible to access or modify a variable that is considered private.  This can

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list