future_builtins

future_builtins — Python 3 builtins

New in version 2.6.

This module provides functions that exist in 2.x, but have different behavior in Python 3, so they cannot be put into the 2.x builtins namespace.

Instead, if you want to write code compatible with Python 3 builtins, import them from this module, like this:

from future_builtins import map, filter

... code using Python 3-style map and filter ...

The 2to3 tool that ports Python 2 code to Python 3 will recognize this usage and leave the new builtins alone.

Note

The Python 3 登录查看完整内容