Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/future/__init__.py: 100%
9 statements
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:53 +0000
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:53 +0000
1"""
2future: Easy, safe support for Python 2/3 compatibility
3=======================================================
5``future`` is the missing compatibility layer between Python 2 and Python
63. It allows you to use a single, clean Python 3.x-compatible codebase to
7support both Python 2 and Python 3 with minimal overhead.
9It is designed to be used as follows::
11 from __future__ import (absolute_import, division,
12 print_function, unicode_literals)
13 from builtins import (
14 bytes, dict, int, list, object, range, str,
15 ascii, chr, hex, input, next, oct, open,
16 pow, round, super,
17 filter, map, zip)
19followed by predominantly standard, idiomatic Python 3 code that then runs
20similarly on Python 2.6/2.7 and Python 3.3+.
22The imports have no effect on Python 3. On Python 2, they shadow the
23corresponding builtins, which normally have different semantics on Python 3
24versus 2, to provide their Python 3 semantics.
27Standard library reorganization
28~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30``future`` supports the standard library reorganization (PEP 3108) through the
31following Py3 interfaces:
33 >>> # Top-level packages with Py3 names provided on Py2:
34 >>> import html.parser
35 >>> import queue
36 >>> import tkinter.dialog
37 >>> import xmlrpc.client
38 >>> # etc.
40 >>> # Aliases provided for extensions to existing Py2 module names:
41 >>> from future.standard_library import install_aliases
42 >>> install_aliases()
44 >>> from collections import Counter, OrderedDict # backported to Py2.6
45 >>> from collections import UserDict, UserList, UserString
46 >>> import urllib.request
47 >>> from itertools import filterfalse, zip_longest
48 >>> from subprocess import getoutput, getstatusoutput
51Automatic conversion
52--------------------
54An included script called `futurize
55<http://python-future.org/automatic_conversion.html>`_ aids in converting
56code (from either Python 2 or Python 3) to code compatible with both
57platforms. It is similar to ``python-modernize`` but goes further in
58providing Python 3 compatibility through the use of the backported types
59and builtin functions in ``future``.
62Documentation
63-------------
65See: http://python-future.org
68Credits
69-------
71:Author: Ed Schofield, Jordan M. Adler, et al
72:Sponsor: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
73 Ltd, Singapore. http://pythoncharmers.com
74:Others: See docs/credits.rst or http://python-future.org/credits.html
77Licensing
78---------
79Copyright 2013-2019 Python Charmers Pty Ltd, Australia.
80The software is distributed under an MIT licence. See LICENSE.txt.
82"""
84__title__ = 'future'
85__author__ = 'Ed Schofield'
86__license__ = 'MIT'
87__copyright__ = 'Copyright 2013-2019 Python Charmers Pty Ltd'
88__ver_major__ = 0
89__ver_minor__ = 18
90__ver_patch__ = 3
91__ver_sub__ = ''
92__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
93 __ver_patch__, __ver_sub__)