any interest in type-scoped static constants?
Paul Miller
paul at fxtech.com
Sun Mar 11 16:43:16 EST 2001
> Why do you need a PEP when you can implement it for any extension you
> need. Just put a dictionary in the type and using type.getattr to look
> stuff up in your dictionary.
Correct me if I am wrong, but do you not need an *object* of the type
before you can call getattr on it?
In other words, I would have to do this:
constant_value = Point().CONSTANT_VALUE
Which would first CREATE an object of that type, then call its getattr()
method where I can look at the argument. I want to avoid creating
objects just to get a constant which is associated with the TYPE and not
the object.
More information about the Python-list
mailing list