bpo-30466: Add brief explanation of classes to tutorial (GH-1804) (GH… · python/cpython@ef4231a (original) (raw)

Original file line number Diff line number Diff line change
@@ -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