future


Namefuture JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://python-future.org
SummaryClean single-source support for Python 3 and 2
upload_time2024-02-21 11:52:38
maintainer
docs_urlhttps://pythonhosted.org/future/
authorEd Schofield
requires_python>=2.6, !=3.0.*, !=3.1.*, !=3.2.*
licenseMIT
keywords future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
future: Easy, safe support for Python 2/3 compatibility
=======================================================

``future`` is the missing compatibility layer between Python 2 and Python
3. It allows you to use a single, clean Python 3.x-compatible codebase to
support both Python 2 and Python 3 with minimal overhead.

It is designed to be used as follows::

    from __future__ import (absolute_import, division,
                            print_function, unicode_literals)
    from builtins import (
             bytes, dict, int, list, object, range, str,
             ascii, chr, hex, input, next, oct, open,
             pow, round, super,
             filter, map, zip)

followed by predominantly standard, idiomatic Python 3 code that then runs
similarly on Python 2.6/2.7 and Python 3.3+.

The imports have no effect on Python 3. On Python 2, they shadow the
corresponding builtins, which normally have different semantics on Python 3
versus 2, to provide their Python 3 semantics.


Standard library reorganization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``future`` supports the standard library reorganization (PEP 3108) through the
following Py3 interfaces:

    >>> # Top-level packages with Py3 names provided on Py2:
    >>> import html.parser
    >>> import queue
    >>> import tkinter.dialog
    >>> import xmlrpc.client
    >>> # etc.

    >>> # Aliases provided for extensions to existing Py2 module names:
    >>> from future.standard_library import install_aliases
    >>> install_aliases()

    >>> from collections import Counter, OrderedDict   # backported to Py2.6
    >>> from collections import UserDict, UserList, UserString
    >>> import urllib.request
    >>> from itertools import filterfalse, zip_longest
    >>> from subprocess import getoutput, getstatusoutput


Automatic conversion
--------------------

An included script called `futurize
<https://python-future.org/automatic_conversion.html>`_ aids in converting
code (from either Python 2 or Python 3) to code compatible with both
platforms. It is similar to ``python-modernize`` but goes further in
providing Python 3 compatibility through the use of the backported types
and builtin functions in ``future``.


Documentation
-------------

See: https://python-future.org


Credits
-------

:Author:  Ed Schofield, Jordan M. Adler, et al
:Sponsor: Python Charmers: https://pythoncharmers.com
:Others:  See docs/credits.rst or https://python-future.org/credits.html


Licensing
---------
Copyright 2013-2024 Python Charmers, Australia.
The software is distributed under an MIT licence. See LICENSE.txt.


            

Raw data

            {
    "_id": null,
    "home_page": "https://python-future.org",
    "name": "future",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/future/",
    "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*",
    "maintainer_email": "",
    "keywords": "future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2",
    "author": "Ed Schofield",
    "author_email": "ed@pythoncharmers.com",
    "download_url": "https://files.pythonhosted.org/packages/a7/b2/4140c69c6a66432916b26158687e821ba631a4c9273c474343badf84d3ba/future-1.0.0.tar.gz",
    "platform": null,
    "description": "\nfuture: 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\n    from __future__ import (absolute_import, division,\n                            print_function, unicode_literals)\n    from builtins import (\n             bytes, dict, int, list, object, range, str,\n             ascii, chr, hex, input, next, oct, open,\n             pow, round, super,\n             filter, 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.standard_library import install_aliases\n    >>> install_aliases()\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, zip_longest\n    >>> from subprocess import getoutput, getstatusoutput\n\n\nAutomatic conversion\n--------------------\n\nAn included script called `futurize\n<https://python-future.org/automatic_conversion.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: https://python-future.org\n\n\nCredits\n-------\n\n:Author:  Ed Schofield, Jordan M. Adler, et al\n:Sponsor: Python Charmers: https://pythoncharmers.com\n:Others:  See docs/credits.rst or https://python-future.org/credits.html\n\n\nLicensing\n---------\nCopyright 2013-2024 Python Charmers, Australia.\nThe software is distributed under an MIT licence. See LICENSE.txt.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Clean single-source support for Python 3 and 2",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://python-future.org",
        "Source": "https://github.com/PythonCharmers/python-future"
    },
    "split_keywords": [
        "future",
        "past",
        "python3",
        "migration",
        "futurize",
        "backport",
        "six",
        "2to3",
        "modernize",
        "pasteurize",
        "3to2"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da71ae30dadffc90b9006d77af76b393cb9dfbfc9629f339fc1574a1c52e6806",
                "md5": "232c541d97f2806d143148651e8bc031",
                "sha256": "929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216"
            },
            "downloads": -1,
            "filename": "future-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "232c541d97f2806d143148651e8bc031",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*",
            "size": 491326,
            "upload_time": "2024-02-21T11:52:35",
            "upload_time_iso_8601": "2024-02-21T11:52:35.956157Z",
            "url": "https://files.pythonhosted.org/packages/da/71/ae30dadffc90b9006d77af76b393cb9dfbfc9629f339fc1574a1c52e6806/future-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7b24140c69c6a66432916b26158687e821ba631a4c9273c474343badf84d3ba",
                "md5": "028bd8af5a7dd853fd12c8bf627236a9",
                "sha256": "bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05"
            },
            "downloads": -1,
            "filename": "future-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "028bd8af5a7dd853fd12c8bf627236a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*",
            "size": 1228490,
            "upload_time": "2024-02-21T11:52:38",
            "upload_time_iso_8601": "2024-02-21T11:52:38.461835Z",
            "url": "https://files.pythonhosted.org/packages/a7/b2/4140c69c6a66432916b26158687e821ba631a4c9273c474343badf84d3ba/future-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 11:52:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PythonCharmers",
    "github_project": "python-future",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "future"
}
        
Elapsed time: 0.23487s