Class Variable Question

Robert Johnson rjohnson at exotic-eo.com
Tue Apr 10 02:28:53 EDT 2001


> The original poster was very explicitly talking about a *class* object,
> not an *instance* object, which is why I didn't provide this pretty
> standard part -- it doesn't work on class-objects (nor modules, &c).
>
Actually I was referring to the instance of the class (I use the term
"Object" as meaning the instance of the class).  Most books I have read use
the term "Object" in this manner.  Sorry for the confusion.

I think the feature I was looking for was something similar to the Options
Explicit option of Visual Basic.  Sometimes I type fairly quickly and as
such have been known to transpose letters.  I would have much preferred to
catch a compile-time error rather than have to move line-by-line through my
code looking for the misspelled term.  This wouldn't be a big deal for a
small program, but if I planned to develop anything of scale, this could
really pose some serious problems.

In fact, most authors of Visual Basic advise to turn Options Explicit on
because it is a source of problems for the average Visual Basic programmer.
I can't imagine it not being a source of bugs, especially when code gets
large.  I understand that some may see it as a feature, but for me it would
be something I would like to turn off.

I am coming from the C++ world where if one wanted to extend a class, one
would override the base class (or insert into the original class if you had
the source) and add any additional variables to the new class.  It just
seemed odd to me that one could just add things on the fly, but that is just
my bias.

Robert Johnson





More information about the Python-list mailing list