diff options
Diffstat (limited to 'Doc/tutorial/classes.rst')
-rw-r--r-- | Doc/tutorial/classes.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index d6e8ca1..d6842e0 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -14,7 +14,7 @@ multiple base classes, a derived class can override any methods of its base class or classes, and a method can call the method of a base class with the same name. Objects can contain an arbitrary amount of private data. -In C++ terminology, normally class members (including the data members) are +In C++ terminology, normally class members (including the data members) are *public* (except see below :ref:`tut-private`), and all member functions are *virtual*. There are no special constructors or destructors. As in Modula-3, there are no shorthands for referencing the @@ -171,7 +171,7 @@ binding:: def do_global(): global spam spam = "global spam" - + spam = "test spam" do_local() print("After local assignment:", spam) @@ -302,7 +302,7 @@ are passed on to :meth:`__init__`. For example, :: ... def __init__(self, realpart, imagpart): ... self.r = realpart ... self.i = imagpart - ... + ... >>> x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) @@ -532,7 +532,7 @@ Python has two builtin functions that work with inheritance: is ``True`` since :class:`bool` is a subclass of :class:`int`. However, ``issubclass(float, int)`` is ``False`` since :class:`float` is not a subclass of :class:`int`. - + .. _tut-multiple: |