@@ -15,9 +15,9 @@ As of version 0.14, the ``future`` package comes with top-level packages for
1515Python 2.x that provide access to the reorganized standard library modules
1616under their Python 3.x names.
1717
18- Direct imports are the preferred mechanism for accesing the renamed standard library
19- modules in Python 2/3 compatible code. For example, the following clean Python
20- 3 code runs unchanged on Python 2 after installing ``future ``::
18+ Direct imports are the preferred mechanism for accesing the renamed standard
19+ library modules in Python 2/3 compatible code. For example, the following clean
20+ Python 3 code runs unchanged on Python 2 after installing ``future ``::
2121
2222 >>> # Alias for future.builtins on Py2:
2323 >>> from builtins import str, open, range, dict
@@ -28,8 +28,8 @@ modules in Python 2/3 compatible code. For example, the following clean Python
2828 >>> import tkinter.dialog
2929 >>> etc.
3030
31- Notice that this code actually runs on Python 3 without the presence of the `` future ``
32- package.
31+ Notice that this code actually runs on Python 3 without the presence of the
32+ `` future `` package.
3333
3434Of the 44 modules that were refactored with PEP 3108 (standard library
3535reorganization), 30 are supported with direct imports in the above manner. The
@@ -92,21 +92,21 @@ package makes the Python 3.x APIs available on Python 2.x as follows::
9292 from future.standard_library import install_aliases
9393 install_aliases()
9494
95- from collections import Counter, OrderedDict # backported to Py2.6
9695 from collections import UserDict, UserList, UserString
9796
9897 import dbm
9998 import dbm.dumb
100- import dbm.gnu # requires Python dbm support
101- import dbm.ndbm # requires Python dbm support
99+ import dbm.gnu # requires Python dbm support
100+ import dbm.ndbm # requires Python dbm support
102101
103102 from itertools import filterfalse, zip_longest
104103
105- from subprocess import check_output # backported to Py2.6
106104 from subprocess import getoutput, getstatusoutput
107105
108106 from sys import intern
109107
108+ from math import ceil # now returns an int
109+
110110 import test.support
111111
112112 import urllib.error
@@ -116,6 +116,22 @@ package makes the Python 3.x APIs available on Python 2.x as follows::
116116 import urllib.robotparser
117117
118118
119+ Backports also exist of the following features from Python 2.7+ for Python 2.6:
120+
121+ - collections.Counter
122+ - collections.OrderedDict
123+ - itertools.count (with an optional step parameter)
124+
125+ These can be imported on Python 2.6 as follows::
126+
127+ from future.standard_library import install_aliases
128+ install_aliases()
129+
130+ from collections import Counter, OrderedDict
131+ from itertools import count
132+ from subprocess import check_output
133+
134+
119135External standard-library backports
120136-----------------------------------
121137
0 commit comments