]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-30466: Add brief explanation of classes to tutorial (GH-1804)
authorTrey Hunner <trey@treyhunner.com>
Thu, 13 Jul 2017 02:30:37 +0000 (19:30 -0700)
committerMariatta <Mariatta@users.noreply.github.com>
Thu, 13 Jul 2017 02:30:37 +0000 (19:30 -0700)
Doc/tutorial/classes.rst

index 073444cf8b3985ca33585aff51663f67809ab358..95141f94d6accbaf53fe30dcc99616414eee2308 100644 (file)
@@ -4,6 +4,12 @@
 Classes
 *******
 
+Classes provide a means of bundling data and functionality together.  Creating
+a new class creates a new *type* of object, allowing new *instances* of that
+type to be made.  Each class instance can have attributes attached to it for
+maintaining its state.  Class instances can also have methods (defined by its
+class) for modifying its state.
+
 Compared with other programming languages, Python's class mechanism adds classes
 with a minimum of new syntax and semantics.  It is a mixture of the class
 mechanisms found in C++ and Modula-3.  Python classes provide all the standard