Really stupid question regarding PEP 252 and type/class unification

Russell Turpin russell_turpin at hotmail.com
Wed Aug 22 21:44:18 CEST 2001


Let me begin with a caveat: I am zonked out on cold drugs. 
My reading of the PEP, and writing of this post, might 
suffer because of this. Throwing caution to the wind, 
here's my stupid question: What is the name (if any) of a 
type's (now class's) value attribute? Let me explain. 
Suppose I create an integer:

    spam = 3

The variable "spam" is an Integer, "Integer" is now a class
(unification, right?), so there should be *some* attribute
of the class Integer, lets call it __myval__, such that:

    spam.__myval__ == 3

And, in fact, writing "spam" in most assignments and tests
should just be a shorthand for "spam.__myval__". Further,
"__myval__" should be in Integer.__dict__, so that 
introspection works with it as with other attributes. 

Does this make any sense? Or should I swear off cold meds 
when posting to comp.lang.python?

Russell



More information about the Python-list mailing list