|
7 | 7 | Classes provide a means of bundling data and functionality together. Creating |
8 | 8 | a new class creates a new *type* of object, allowing new *instances* of that |
9 | 9 | type to be made. Each class instance can have attributes attached to it for |
10 | | -maintaining its state. Class instances can also have methods (defined by its |
| 10 | +maintaining its state. Class instances can also have methods (defined by their |
11 | 11 | class) for modifying its state. |
12 | 12 |
|
13 | 13 | Compared with other programming languages, Python's class mechanism adds classes |
@@ -73,7 +73,7 @@ implemented as Python dictionaries, but that's normally not noticeable in any |
73 | 73 | way (except for performance), and it may change in the future. Examples of |
74 | 74 | namespaces are: the set of built-in names (containing functions such as :func:`abs`, and |
75 | 75 | built-in exception names); the global names in a module; and the local names in |
76 | | -a function invocation. In a sense the set of attributes of an object also form |
| 76 | +a function invocation. In a sense the set of attributes of an object also forms |
77 | 77 | a namespace. The important thing to know about namespaces is that there is |
78 | 78 | absolutely no relation between names in different namespaces; for instance, two |
79 | 79 | different modules may both define a function ``maximize`` without confusion --- |
@@ -229,7 +229,7 @@ The simplest form of class definition looks like this:: |
229 | 229 | . |
230 | 230 | <statement-N> |
231 | 231 |
|
232 | | -Class definitions, like function definitions (:keyword:`def` statements) must be |
| 232 | +Class definitions, like function definitions (:keyword:`def` statements), must be |
233 | 233 | executed before they have any effect. (You could conceivably place a class |
234 | 234 | definition in a branch of an :keyword:`if` statement, or inside a function.) |
235 | 235 |
|
@@ -642,7 +642,7 @@ attributes inherited from a parent class as depth-first, left-to-right, not |
642 | 642 | searching twice in the same class where there is an overlap in the hierarchy. |
643 | 643 | Thus, if an attribute is not found in :class:`!DerivedClassName`, it is searched |
644 | 644 | for in :class:`!Base1`, then (recursively) in the base classes of :class:`!Base1`, |
645 | | -and if it was not found there, it was searched for in :class:`!Base2`, and so on. |
| 645 | +and if it is not found there, it is searched for in :class:`!Base2`, and so on. |
646 | 646 |
|
647 | 647 | In fact, it is slightly more complex than that; the method resolution order |
648 | 648 | changes dynamically to support cooperative calls to :func:`super`. This |
@@ -889,8 +889,8 @@ compact is that the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` m |
889 | 889 | are created automatically. |
890 | 890 |
|
891 | 891 | Another key feature is that the local variables and execution state are |
892 | | -automatically saved between calls. This made the function easier to write and |
893 | | -much more clear than an approach using instance variables like ``self.index`` |
| 892 | +automatically saved between calls. This makes the function easier to write and |
| 893 | +much clearer than an approach using instance variables like ``self.index`` |
894 | 894 | and ``self.data``. |
895 | 895 |
|
896 | 896 | In addition to automatic method creation and saving program state, when |
|
0 commit comments