any plans to make pprint() a builtin?

Tim Golden tjgolden at gmail.com
Sun May 14 15:35:22 CEST 2006


Duncan Booth wrote:
> John Salerno wrote:
>
> > Just wondering if this will ever happen, maybe in 3.0 when print becomes
> > a function too? It would be a nice option to have it available without
> > importing it every time, but maybe making it a builtin violates some
> > kind of pythonic ideal?
>
> There are so many things which *could* be builtins, and it really is better
> not to pollute the global namespace with more than absolutely necessary.
>
> Personally I'd just like to see 'python' a builtin shorthand for importing
> a name you aren't going to use much
>  e.g.
>
>     python.pprint.pprint(x)

I think that's what the py.lib people have done with
their py.std module:

http://codespeak.net/py/current/doc/misc.html#the-py-std-hook

(At least, it looks like it; I've never used it myself).

TJG




More information about the Python-list mailing list