any interest in type-scoped static constants?
Aahz Maruch
aahz at panix.com
Sun Mar 11 14:21:15 EST 2001
In article <3AABCA0E.CB3E2F4A at fxtech.com>,
Paul Miller <paul at fxtech.com> wrote:
>Aahz:
>>
>> Python itself, the way I'd do this is to create a module Point that
>> contains the Point class, and following the class definition create the
>> ZERO object. Then you refer to it as Point.ZERO and create new points
>> with Point.Point().
>
>You are right that I could do this. However, I'm talking about extension
>types. If I am embedding Python in an app, I may be providing several
>extension types, that provide access to my internal C++ classes.
>However, I do not want to make a module for each type.
Again talking in terms of what I'd do in Python, I'd handle this by
writing a package with internal modules. I don't know if it's possible
to build virtual packages in extensions.
--
--- Aahz (Copyright 2001 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"Perhaps God rewards martyrs, but life seldom does..." --Ulrika O'Brien
More information about the Python-list
mailing list