summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorTrey Hunner <trey@treyhunner.com>2017-07-13 02:30:37 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-07-13 02:30:37 (GMT)
commit3fbd70018f835edd33250de2f79b7a7ef45f8359 (patch)
tree9258496d47b19f962f1f757c49f3f0f820ec2a8c /Doc
parentab025e31abbf9fdb37599dab94507ec429dc3b30 (diff)
downloadcpython-3fbd70018f835edd33250de2f79b7a7ef45f8359.zip
cpython-3fbd70018f835edd33250de2f79b7a7ef45f8359.tar.gz
cpython-3fbd70018f835edd33250de2f79b7a7ef45f8359.tar.bz2
bpo-30466: Add brief explanation of classes to tutorial (GH-1804)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tutorial/classes.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index 073444c..95141f9 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