Skip to content

Commit ef4231a

Browse files
treyhunnerMariatta
authored andcommitted
bpo-30466: Add brief explanation of classes to tutorial (GH-1804) (GH-2700)
1 parent 96ef06f commit ef4231a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/tutorial/classes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
Classes
55
*******
66

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+
713
Compared with other programming languages, Python's class mechanism adds classes
814
with a minimum of new syntax and semantics. It is a mixture of the class
915
mechanisms found in C++ and Modula-3. Python classes provide all the standard

0 commit comments

Comments
 (0)