@@ -4,6 +4,12 @@ |
|
|
4 |
4 |
Classes |
5 |
5 |
******* |
6 |
6 |
|
|
7 |
+Classes provide a means of bundling data and functionality together. Creating |
|
8 |
+a new class creates a new *type* of object, allowing new *instances* of that |
|
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 |
|
11 |
+class) for modifying its state. |
|
12 |
+ |
7 |
13 |
Compared with other programming languages, Python's class mechanism adds classes |
8 |
14 |
with a minimum of new syntax and semantics. It is a mixture of the class |
9 |
15 |
mechanisms found in C++ and Modula-3. Python classes provide all the standard |