Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/tutorial/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ instance objects are attribute references. There are two kinds of valid
attribute names: data attributes and methods.

*Data attributes* correspond to "instance variables" in Smalltalk, and to "data
members" in C++. Data attributes need not be declared; like local variables,
members" in C++. Data attributes don't have to be declared like local variables,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find this wording better. I prefer the current one. Or, reword it as "Like local variables, data attributes do not need to be declared and spring into existence"

they spring into existence when they are first assigned to. For example, if
``x`` is the instance of :class:`!MyClass` created above, the following piece of
code will print the value ``16``, without leaving a trace::
Expand Down Expand Up @@ -921,7 +921,7 @@ Examples::
>>> sum(x*y for x,y in zip(xvec, yvec)) # dot product
260

>>> unique_words = set(word for line in page for word in line.split())
>>> unique_words = set(word for line in page for word in line.split())

>>> valedictorian = max((student.gpa, student.name) for student in graduates)

Expand Down
Loading