Skip to content

bpo-12634: Clarify an awkward section of the tutorial#15406

Merged
rhettinger merged 1 commit into
python:masterfrom
rhettinger:tutorial_random_remarks
Aug 23, 2019
Merged

bpo-12634: Clarify an awkward section of the tutorial#15406
rhettinger merged 1 commit into
python:masterfrom
rhettinger:tutorial_random_remarks

Conversation

@rhettinger
Copy link
Copy Markdown
Contributor

@rhettinger rhettinger commented Aug 22, 2019

Copy link
Copy Markdown
Contributor

@eamanu eamanu left a comment

Choose a reason for hiding this comment

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

I think is a good improvement.

Comment thread Doc/tutorial/classes.rst
it is wise to use some kind of convention that minimizes the chance of
conflicts. Possible conventions include capitalizing method names, prefixing
data attribute names with a small unique string (perhaps just an underscore), or
using verbs for methods and nouns for data attributes.
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.

Wow. At first I was confused. If one defines module, class, or instance attributes with the same name, the second wins. Then the first two advice items are wrong, the third correct, but misses the realistic case of noun data attribute duplication on class and instance. Your example covers that nicely. Please apply and backport.

Comment thread Doc/tutorial/classes.rst
@bedevere-bot
Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@rhettinger rhettinger merged commit 483ae0c into python:master Aug 23, 2019
@rhettinger rhettinger deleted the tutorial_random_remarks branch August 23, 2019 06:27
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link
Copy Markdown

GH-15409 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 23, 2019
(cherry picked from commit 483ae0c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
rhettinger added a commit that referenced this pull request Aug 23, 2019
…15409)

(cherry picked from commit 483ae0c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
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 skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants