Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial: classes intro paragraph icky #53384

Closed
aahz mannequin opened this issue Jul 1, 2010 · 5 comments
Closed

Tutorial: classes intro paragraph icky #53384

aahz mannequin opened this issue Jul 1, 2010 · 5 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@aahz
Copy link
Mannequin

aahz mannequin commented Jul 1, 2010

BPO 9138
Nosy @birkenfeld, @rhettinger

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-10-17.10:44:50.027>
created_at = <Date 2010-07-01.21:48:53.190>
labels = ['type-bug', 'docs']
title = 'Tutorial: classes intro paragraph icky'
updated_at = <Date 2010-10-17.10:44:58.827>
user = 'https://bugs.python.org/aahz'

bugs.python.org fields:

activity = <Date 2010-10-17.10:44:58.827>
actor = 'georg.brandl'
assignee = 'docs@python'
closed = True
closed_date = <Date 2010-10-17.10:44:50.027>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2010-07-01.21:48:53.190>
creator = 'aahz'
dependencies = []
files = []
hgrepos = []
issue_num = 9138
keywords = []
message_count = 5.0
messages = ['109080', '109083', '109084', '118928', '118929']
nosy_count = 5.0
nosy_names = ['georg.brandl', 'rhettinger', 'aahz', 'techtonik', 'docs@python']
pr_nums = []
priority = 'critical'
resolution = 'fixed'
stage = 'patch review'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue9138'
versions = ['Python 2.7']

@aahz
Copy link
Mannequin Author

aahz mannequin commented Jul 1, 2010

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.

@aahz aahz mannequin assigned docspython Jul 1, 2010
@aahz aahz mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Jul 1, 2010
@rhettinger
Copy link
Contributor

+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".

@techtonik
Copy link
Mannequin

techtonik mannequin commented Jul 1, 2010

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.

@birkenfeld
Copy link
Member

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".

@birkenfeld
Copy link
Member

r85627.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants