[Python-Dev] __pycode__ extension

Samuele Pedroni pedronis at bluewin.ch
Tue Nov 16 20:40:35 CET 2004


Phillip J. Eby wrote:

> At 02:01 PM 11/16/04 -0500, Jeremy Hylton wrote:
> 
>> On Tue, 16 Nov 2004 10:51:06 -0800, Stelios Xanthakis
>> <sxanth at ceid.upatras.gr> wrote:
>> >
>> > Hi.
>> >
>> > I posted a message on c.l.p a couple of days ago about a
>> > python patch which adds a member __pycde__ to functions and
>> > classes. This member is a string which holds the python code of
>> > the function/class. (It works in interactively defined code
>> > and exec'd definitions)
>>
>> Functions already have a reference to code objects.  How is this 
>> different?
> 
> 
> I believe he means the Python source code; I personally would suggest a 
> name like '__source__' instead of '__pycode__' as the attribute name.
> 
> Of course, I'd also almost prefer to have the AST than the original 
> source...  ;)

a prerequiste for that is likely the ast-branch, because the old
"A"STs are not a reasonable format to be mandated for all python
implementations.




More information about the Python-Dev mailing list