[Python-3000] comments (original) (raw)
Jim Jewett jimjjewett at gmail.com
Sun May 6 19:33:52 CEST 2007
- Previous message: [Python-3000] comments
- Next message: [Python-3000] comments
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-3000] comments
- Next message: [Python-3000] comments
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]