[Python-Dev] __pycode__ extension

Samuele Pedroni pedronis at bluewin.ch
Thu Nov 18 16:52:35 CET 2004


Phillip J. Eby wrote:

> 
> And I'd vote differently on both these matters.  Please state what your 
> use cases are, so that solutions can be evaluated on the basis of what 
> use cases they satisfy, not merely votes without any context.
> 

I don't get why your are particularly opposed to attaching source for 
exec-ed/eval-ed code,

I think that expanding the cases where inspect.getsource just work 
directly is valuable. And doing that seem a natural way to achieve this.

OTOH I personally fully appreciate why you may want to have it work
even if just pycs are around.

Stelios Xanthakis wrote:
 > Having used this system,
 > 'import' is a good barrier to say "I'm not interested for
 > the __pycode__ of these".

but for example having access to co_filename and or equilavent
(something would have to be for done for classes about this)
is probably also good enough to make that distinction:

 >>> def f(): pass
...
 >>> f.func_code.co_filename
'<stdin>'
 >>>



More information about the Python-Dev mailing list