[Python-Dev] __pycode__ extension

Phillip J. Eby pje at telecommunity.com
Tue Nov 16 20:21:46 CET 2004

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...  ;)

More information about the Python-Dev mailing list