[Python-ideas] Add `future_builtins` as an alias for `builtins`

Mike Graham mikegraham at gmail.com
Wed May 9 22:26:00 CEST 2012


On Wed, May 9, 2012 at 2:48 PM, Sven Marnach <sven at marnach.net> wrote:

> With the reintroduction of u"Unicode literals", Python 3.3 will remove
> one of the major stumbling stones for supporting Python 2.x and 3.3
> within the same code base.  Another rather trivial stumbling stone
> could be removed by adding the alias `future_builtins` for the
> `builtins` module.  Currently, you need to use a try/except block,
> which isn't too bad, but I think it would be nicer if a line like
>
>    from future_builtins import map
>
> continues to work, just like __future__ imports continue to work.  I
> think the above actually *is* a kind of __future__ report which just
> happens to be in a regular module because it doesn't need any special
> compiler support.
>
> I know a few module names changed and some modules have been
> reorganised to packages, so you will still need try/except blocks for
> other imports.  However, I think `future_builtins` is special because
> it's sole raison d'être is forward-compatibility and becuase of the
> analogy with `__future__`.
>
> Cheers,
>    Sven


Sounds like it will do more good than harm.

+1

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120509/347e7abc/attachment.html>


More information about the Python-ideas mailing list