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

Jakob Bowyer jkbbwr at gmail.com
Wed May 9 22:28:31 CEST 2012


Why not for naming call it from __future__.builtins import map

On Wed, May 9, 2012 at 7: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
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



More information about the Python-ideas mailing list