From 299172bdbaaf767cbe4eb1ae425c6cfc9173f953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 26 Jul 2011 16:54:24 +0200 Subject: Make indentation comply with our style guide and the rest of the file --- Doc/tutorial/classes.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f9a2d11..c3640a0 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -556,24 +556,24 @@ occurs within the definition of a class. 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 -- cgit v0.12