[Python-3000] comments
Jim Jewett
jimjjewett at gmail.com
Sun May 6 19:33:52 CEST 2007
On 5/6/07, tomer filiba <tomerfiliba at gmail.com> wrote:
> 3130 (Access to Current Module/Class/Function)
> ------------------------------------------------
> why make them keywords? they could as well be builtin functions,
> like globals() and locals(). i.e., getmodule(), getclass(), and
> getfunction(). these functions will just climb up the stack frames
> until they find what you're asking for.
Because I couldn't figure out how to do it after compile-time.
> also -- the class object is constructed only AFTER the code
> of the class has finished executing, meaning getclass()
> or __thisclass__ will not work at class level.
Correct, but it would work within methods of the class. Functions
also don't exist while still being defined, and modules aren't fully
usable while being defined.
-jJ
More information about the Python-3000
mailing list