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.

Author ABELARDOLG
Recipients ABELARDOLG, Dennis Sweeney, docs@python, steven.daprano
Date 2020-06-30.08:51:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593507062.48.0.651907335352.issue41166@roundup.psfhosted.org>
In-reply-to
Content
Sorry, I don't have any doc where "class value" / "instance value" are mentioned. This idea is original from me originally based on my personal interpretation about OOP basic concepts. But it doesn't mean I'm wrong with my proposal. 

When you use the following notation:
"foo.a" you are accessing to the value of that attribute. In Python, you would write: print(foo.a) to print the value of that attribute, being 'foo' an instance of the Foo class. Right.

All attributes are inheriting from a class; so, any attribute inside an instance is a "class attribute" but here I am not discussing this but the value itself.

This confusion could be caused because Python could implement a mechanism different than other OOP programming languages and I'm not sure if Python strictly follows this paradigm. 

I am a newbie in Python but not in OOP paradigm, where my discussion is focused. 

If Python doesn't strictly follow the OOP paradigm, you could gently delete this issue because we wouldn't talk about the same concept.

Otherwise, let's explain why I think the concept "class attribute" is wrong from my viewpoint.

IMHO, a "class attribute" doesn't exist in OOP as is. Really, a "class value" exists instead. A "class value" is a value (pay attention, please: not an attribute) shared among all instances from a class. You can do this by tagging an attribute as "static" (in Java and PHP, for example). The value of that attribute is, again, shared among all instances of that class. 

Nevertheless, when you don't declare an attribute with the tag "static" you are requiring the value (!) is not being shared among their instances.

It's not applied to attributes but values.

The attribute always is a class level property (all instances share this property still when the instances don't contain the same value for it).

Disclaimer: I'm not an English native. I made all my best to decently express in English but since it is not my native language I could have made typos which could twist my words.

Best regards.
History
Date User Action Args
2020-06-30 08:51:02ABELARDOLGsetrecipients: + ABELARDOLG, steven.daprano, docs@python, Dennis Sweeney
2020-06-30 08:51:02ABELARDOLGsetmessageid: <1593507062.48.0.651907335352.issue41166@roundup.psfhosted.org>
2020-06-30 08:51:02ABELARDOLGlinkissue41166 messages
2020-06-30 08:51:02ABELARDOLGcreate