Issue #23921: Standardized documentation whitespace formatting.
Original patch by James Edwards.
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index d82adf6..b1f3f00 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -210,6 +210,7 @@
class MyClass:
"""A simple example class"""
i = 12345
+
def f(self):
return 'hello world'
@@ -458,8 +459,10 @@
class C:
f = f1
+
def g(self):
return 'hello world'
+
h = g
Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer to
@@ -473,8 +476,10 @@
class Bag:
def __init__(self):
self.data = []
+
def add(self, x):
self.data.append(x)
+
def addtwice(self, x):
self.add(x)
self.add(x)
@@ -670,7 +675,7 @@
class Employee:
pass
- john = Employee() # Create an empty employee record
+ john = Employee() # Create an empty employee record
# Fill the fields of the record
john.name = 'John Doe'
@@ -796,8 +801,10 @@
def __init__(self, data):
self.data = data
self.index = len(data)
+
def __iter__(self):
return self
+
def next(self):
if self.index == 0:
raise StopIteration