-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Random Remarks in class documentation #56843
Comments
URL: http://docs.python.org/tutorial/classes.html The first sentense is bit confusing: Is it possible to change the sentense something like this: |
The proposed rewrite doesn't make any sense to me. Also "set through" is an reads awkwardly. |
Indeed that paragraph is not really clear. I had to read it till the end ("verbs for methods and nouns for data attributes") to figure out what it was talking about. Even then it's still not clear what it's trying to say. The whole thing could be rewritten to just say that an attribute name always refers to a single object, either to a method or to some "data". |
I have the same reading as Ezio, and the same opinion that it’s unclear and unhelpful. +1 to saying that there is only one namespace for data attributes and methods. |
That sentence is wrong to imply that there is anything special about data versus method attributes with respect to overriding -- or that attributes are special when it comes to names in a single namespace. What I think the paragraph should say, if not just deleted, is something like. "Instance attributes hide class attributes. Instance data names are often intended to override class data names. But instance data names masking methods names is likely a mistake. This can be avoided by using verbs for method names and nouns for data names." |
+1 to something like Terry’s proposal. |
See also bpo-16048. |
It may be worth to noting that when creating property attribute using the property decorator, we may tend to name the method using nouns, like here: This is when I once overided data attribute with method. |
Based on Teery's comments, this patch makes the changes to the random remarks section of the class documentation |
Similar changes for 2.7 branch |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: