From: Trey Hunner Date: Fri, 21 Jul 2017 03:10:54 +0000 (-0700) Subject: bpo-30466: Add brief explanation of classes to tutorial (GH-1804) (GH-2700) X-Git-Tag: v3.6.3rc1~219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef4231adb7aa6b323c94e854ac3dc3bebc841115;p=thirdparty%2FPython%2Fcpython.git bpo-30466: Add brief explanation of classes to tutorial (GH-1804) (GH-2700) --- diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 073444cf8b39..95141f94d6ac 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -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