This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tutorial: classes intro paragraph icky
Type: behavior Stage: patch review
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: aahz, docs@python, georg.brandl, rhettinger, techtonik
Priority: critical Keywords:

Created on 2010-07-01 21:48 by aahz, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg109080 - (view) Author: Aahz (aahz) * (Python triager) Date: 2010-07-01 21:48
http://docs.python.org/dev/tutorial/classes.html

Chapter 9 of the Tutorial contains this intro paragraph:

    Python's class mechanism adds classes to the language with a minimum
    of new syntax and semantics. It is a mixture of the class mechanisms
    found in C++ and Modula-3. As is true for modules, classes in Python
    do not put an absolute barrier between definition and user, but
    rather rely on the politeness of the user not to "break into the
    definition." The most important features of classes are retained with
    full power, however:  the class inheritance mechanism allows multiple
    base classes, a derived class can override any methods of its base
    class or classes, and a method can call the method of a base class
    with the same name.  Objects can contain an arbitrary amount of data.

A coworker found particularly the third sentence incomprehensible, and
even with ten years of Python under my belt, I can't say that it makes
much more sense to me.  I know what it must be trying to say and
therefore proffer this suggested rewrite:

    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 features of Object Oriented
    Programming: the class inheritance mechanism allows multiple base
    classes, a derived class can override any methods of its base class
    or classes, and a method can call the method of a base class with the
    same name.  Objects can contain arbitrary amounts and kinds of data.
    As is true for modules, classes partake of the dynamic nature of
    Python; users of a class can modify or break the class definition
    even without changing the source code.
msg109083 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-07-01 22:07
+1 on the new wording.

Nits:

* Since many OOP languages don't support multiple inheritance, I don't think we can call multiple inheritance one of the "standard features of Object Oriented Programming". 

* Eventhough the wording is an improvement, I don't see how this could be prioritized as "critical".
msg109084 - (view) Author: anatoly techtonik (techtonik) Date: 2010-07-01 22:56
Much better definition. I stripped it down a little to avoid
"mechanism" repetition.

   Compared with other programming languages, Python provides
   object oriented approach with a minimum of new syntax and semantics.
   Its class mechanism is a mixture of concepts found in C++ and Modula-3.
   Python classes can be inherited from multiple base classes, a derived
   class can override any methods of its base class or classes, and a
   method can call the method of a base class with the
   same name.  Objects can contain arbitrary amounts and kinds of data.
   As is true for modules, classes partake of the dynamic nature of
   Python; users of a class can modify or break the class definition
   even without changing the source code.

However, the sentence about arbitrary amounts and kinds of data seems
strange to me. I would like to see it like "In comparison to XXX where
there is limitation that YYY Python objects can contain arbitrary
amounts and kinds of data."

"users of a class can modify or break the class definition even
without changing the source code." doesn't sound right to me. How can
I *break* the class definition? Maybe it was meant to

   The dynamic nature of Python allows new classes to be defined and
   existing classes modified at run-time.
msg118928 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-17 10:44
Committed Aahz' version, with the last sentence reworded to what I think is more positive than what sounds like "you can break things without doing anything".
msg118929 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-17 10:44
r85627.
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53384
2010-10-17 10:44:58georg.brandlsetmessages: + msg118929
2010-10-17 10:44:50georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg118928

resolution: fixed
2010-07-01 22:56:05techtoniksetnosy: + techtonik
messages: + msg109084
2010-07-01 22:07:04rhettingersetnosy: + rhettinger
messages: + msg109083
2010-07-01 21:48:53aahzcreate