{
    "mode": "pydoc",
    "parameter": "future",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/future/json",
    "generated": "2026-06-02T15:02:09Z",
    "sections": {
        "NAME": {
            "content": "future\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "future: Easy, safe support for Python 2/3 compatibility\n=======================================================\n\n``future`` is the missing compatibility layer between Python 2 and Python\n3. It allows you to use a single, clean Python 3.x-compatible codebase to\nsupport both Python 2 and Python 3 with minimal overhead.\n\nIt is designed to be used as follows::\n\nfrom future import (absoluteimport, division,\nprintfunction, unicodeliterals)\nfrom builtins import (\nbytes, dict, int, list, object, range, str,\nascii, chr, hex, input, next, oct, open,\npow, round, super,\nfilter, map, zip)\n\nfollowed by predominantly standard, idiomatic Python 3 code that then runs\nsimilarly on Python 2.6/2.7 and Python 3.3+.\n\nThe imports have no effect on Python 3. On Python 2, they shadow the\ncorresponding builtins, which normally have different semantics on Python 3\nversus 2, to provide their Python 3 semantics.\n\n\nStandard library reorganization\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n``future`` supports the standard library reorganization (PEP 3108) through the\nfollowing Py3 interfaces:\n\n>>> # Top-level packages with Py3 names provided on Py2:\n>>> import html.parser\n>>> import queue\n>>> import tkinter.dialog\n>>> import xmlrpc.client\n>>> # etc.\n\n>>> # Aliases provided for extensions to existing Py2 module names:\n>>> from future.standardlibrary import installaliases\n>>> installaliases()\n\n>>> from collections import Counter, OrderedDict   # backported to Py2.6\n>>> from collections import UserDict, UserList, UserString\n>>> import urllib.request\n>>> from itertools import filterfalse, ziplongest\n>>> from subprocess import getoutput, getstatusoutput\n\n\nAutomatic conversion\n--------------------\n\nAn included script called `futurize\n<http://python-future.org/automaticconversion.html>` aids in converting\ncode (from either Python 2 or Python 3) to code compatible with both\nplatforms. It is similar to ``python-modernize`` but goes further in\nproviding Python 3 compatibility through the use of the backported types\nand builtin functions in ``future``.\n\n\nDocumentation\n-------------\n\nSee: http://python-future.org\n\n\nCredits\n-------\n\n:Author:  Ed Schofield, Jordan M. Adler, et al\n:Sponsor: Python Charmers Pty Ltd, Australia, and Python Charmers Pte\nLtd, Singapore. http://pythoncharmers.com\n:Others:  See docs/credits.rst or http://python-future.org/credits.html\n\n\nLicensing\n---------\nCopyright 2013-2019 Python Charmers Pty Ltd, Australia.\nThe software is distributed under an MIT licence. See LICENSE.txt.\n",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "backports (package)\nbuiltins (package)\nmoves (package)\nstandardlibrary (package)\ntests (package)\ntypes (package)\nutils (package)\n",
            "subsections": []
        },
        "DATA": {
            "content": "copyright = 'Copyright 2013-2019 Python Charmers Pty Ltd'\nlicense = 'MIT'\ntitle = 'future'\nvermajor = 0\nverminor = 18\nverpatch = 2\nversub = ''\n",
            "subsections": []
        },
        "VERSION": {
            "content": "0.18.2\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Ed Schofield\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/future/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "future",
    "flags": [],
    "examples": [],
    "see_also": []
}