Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72db345

Browse files
committed
Make indentation comply with our style guide and the rest of the file
1 parent 59e387e commit 72db345

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Doc/tutorial/classes.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -598,24 +598,24 @@ occurs within the definition of a class.
598598
Name mangling is helpful for letting subclasses override methods without
599599
breaking intraclass method calls. For example::
600600

601-
class Mapping:
602-
def __init__(self, iterable):
603-
self.items_list = []
604-
self.__update(iterable)
601+
class Mapping:
602+
def __init__(self, iterable):
603+
self.items_list = []
604+
self.__update(iterable)
605605

606-
def update(self, iterable):
607-
for item in iterable:
608-
self.items_list.append(item)
606+
def update(self, iterable):
607+
for item in iterable:
608+
self.items_list.append(item)
609609

610-
__update = update # private copy of original update() method
610+
__update = update # private copy of original update() method
611611

612-
class MappingSubclass(Mapping):
612+
class MappingSubclass(Mapping):
613613

614-
def update(self, keys, values):
615-
# provides new signature for update()
616-
# but does not break __init__()
617-
for item in zip(keys, values):
618-
self.items_list.append(item)
614+
def update(self, keys, values):
615+
# provides new signature for update()
616+
# but does not break __init__()
617+
for item in zip(keys, values):
618+
self.items_list.append(item)
619619

620620
Note that the mangling rules are designed mostly to avoid accidents; it still is
621621
possible to access or modify a variable that is considered private. This can

0 commit comments

Comments
 (0)