This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients alexandre.vassalotti, amaury.forgeotdarc, belopolsky, cool-RR, daniel.urban, eric.araujo, exarkun, hinsen, lemburg, loewis, obamausa8, pitrou, rhettinger
Date 2011-03-02.12:18:47
SpamBayes Score 9.421434e-06
Marked as misclassified No
Message-id <1299068328.2.0.912939793607.issue9276@psf.upfronthosting.co.za>
In-reply-to
Content
OK, let's go back to the "__namespace__" idea, then. 

A long time ago I had the idea that the ast compiler could remember the list of "named blocks" (classes, functions) with their line numbers;
for example, the statement "class C" spans from line 20 to 40, "def foo()" spans from line 26 to 30.
Then, it's easy to locate the function "C.foo" if you only have its co_firstlineno.  This would also be a replacement for the awful hacks in Lib/trace.py::file_module_function_of() (please read the code and say "aaargh!").
This information would be stored in the module itself, and probably compressed with techniques similar to co_lnotab.
History
Date User Action Args
2011-03-02 12:18:48amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, lemburg, loewis, rhettinger, hinsen, exarkun, belopolsky, pitrou, alexandre.vassalotti, eric.araujo, obamausa8, daniel.urban, cool-RR
2011-03-02 12:18:48amaury.forgeotdarcsetmessageid: <1299068328.2.0.912939793607.issue9276@psf.upfronthosting.co.za>
2011-03-02 12:18:47amaury.forgeotdarclinkissue9276 messages
2011-03-02 12:18:47amaury.forgeotdarccreate