Skip to content

Commit

Permalink
Update chapter28.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcafferry committed Jan 9, 2022
1 parent 103d787 commit 810d3e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/chapter28.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Chapter 28: Class Coding Details

As in C++. the class statement is Python's main OOP tool, but unlike in C++, Python's class is not a declaration. Like a def, a class statement is an object builder, and an implicit assignemnt-when run, it generates a class object and stores a reference to it in the name used in the header. when ru, your class exist.

The main distinction for classes is that :strong:`their namespaces are also the basis of inheritance in a class or instance object are fetched from other classes`.

:italic:`All the statements inside the class statement run when the class statement itself runs (not when the class is later called to make an instance). Assigning names inside the class statement makes class attributes, and nested defs make class methods, but other assignments make attributes, too.`

.. code:: python
>>> classs <name> (superclass, ...):
Expand Down

0 comments on commit 810d3e4

Please sign in to comment.