A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/096357.html below:

Class Variable Question

Class Variable QuestionRobert Johnson rjohnson at exotic-eo.com
Wed Apr 11 03:47:07 EDT 2001
> It's not entirely clear to me whether you mean to be talking about
> setting attributes of classes or attributes of class instances.

I am talking about "creating" attributes in class instances (not setting).
I come from the C++ community where the definition of a class is separate
from its implementation.  My ambiguous question and the variety of replies I
received actually helped me to understand that in Python a Class Object is
created the moment it is written and is separate from the Object instance,
which explains why some thought it strange that I would want to be able to
block the adding of attributes, effectively blocking a simple form of
inheritance.  In C++ the class object IS the instance and many C++
programming books use the terms "Object" and "Instance" interchangeably.
The splitting of Object and Instance is something that I did not catch in my
readings of Python programming books.

I think this is the first question I have ever posed to a newsgroup that has
generated such a large thread.

Thanks for the reply,

Robert Johnson



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4