A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-November/058297.html below:

[Python-Dev] a Python interface for the AST (WAS: DRAFT: python-dev...)

[Python-Dev] a Python interface for the AST (WAS: DRAFT: python-dev...) [Python-Dev] a Python interface for the AST (WAS: DRAFT: python-dev...)Brett Cannon bcannon at gmail.com
Wed Nov 23 03:32:59 CET 2005
On 11/22/05, Neal Norwitz <nnorwitz at gmail.com> wrote:
> On 11/22/05, Brett Cannon <bcannon at gmail.com> wrote:
> >
> > But if I had my way I think that having all AST objects be PyObjects
> > and then providing support for all three ways of getting access to the
> > AST (command-line, sys iterable, function for specific code object)
> > would be fantastic.
>
> There needs to be a function that takes a filename (or string of code)
> and returns an AST.

"Yes" and "I guess".  =)  I can see the filename to check a module
useful for stuff like PyChecker.  But for a string of code, I don't
think it would be that critical; if you provide a way to get the AST
for a code object you can just pass the string to compile() and then
get the AST from there.

>  Hmm, it would be nice to give a function a module
> name (like from an import statement) and have Python resolve it using
> the normal sys.path iteration.
>

Yep, import path -> filename path would be cool.

-Brett
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4