Skip to content

Commit c59ebb8

Browse files
committed
Merge branch 'v0.15.x' and tag 'v0.15.1'
2 parents 87c46f4 + 042414f commit c59ebb8

19 files changed

+3462
-3162
lines changed

docs/changelog.rst

+139-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,135 @@ Changes in previous versions
55

66
Changes in the most recent major version are here: :ref:`whats-new`.
77

8+
.. _whats-new-0.14.x:
9+
10+
Changes in version 0.14.3 (2014-12-15)
11+
======================================
12+
13+
This is a bug-fix release:
14+
15+
- Expose contents of ``thread`` (not ``dummy_thread``) as ``_thread`` on Py2 (issue #124)
16+
- Add signed support for ``newint.to_bytes()`` (issue #128)
17+
- Fix ``OrderedDict.clear()`` on Py2.6 (issue #125)
18+
- Improve ``newrange``: equality and slicing, start/stop/step properties, refactoring (issues #129, #130)
19+
- Minor doc updates
20+
21+
Changes in version 0.14.2 (2014-11-21)
22+
======================================
23+
24+
This is a bug-fix release:
25+
26+
- Speed up importing of ``past.translation`` (issue #117)
27+
- ``html.escape()``: replace function with the more robust one from Py3.4
28+
- futurize: avoid displacing encoding comments by __future__ imports (issues #97, #10, #121)
29+
- futurize: don't swallow exit code (issue #119)
30+
- Packaging: don't forcibly remove the old build dir in ``setup.py`` (issue #108)
31+
- Docs: update further docs and tests to refer to ``install_aliases()`` instead of
32+
``install_hooks()``
33+
- Docs: fix ``iteritems`` import error in cheat sheet (issue #120)
34+
- Tests: don't rely on presence of ``test.test_support`` on Py2 or ``test.support`` on Py3 (issue #109)
35+
- Tests: don't override existing ``PYTHONPATH`` for tests (PR #111)
36+
37+
Changes in version 0.14.1 (2014-10-02)
38+
======================================
39+
40+
This is a minor bug-fix release:
41+
42+
- Docs: add a missing template file for building docs (issue #108)
43+
- Tests: fix a bug in error handling while reporting failed script runs (issue #109)
44+
- install_aliases(): don't assume that the ``test.test_support`` module always
45+
exists on Py2 (issue #109)
46+
47+
48+
Changes in version 0.14.0 (2014-10-02)
49+
======================================
50+
51+
This is a major new release that offers a cleaner interface for most imports in
52+
Python 2/3 compatible code.
53+
54+
Instead of this interface::
55+
56+
>>> from future.builtins import str, open, range, dict
57+
58+
>>> from future.standard_library import hooks
59+
>>> with hooks():
60+
... import queue
61+
... import configparser
62+
... import tkinter.dialog
63+
... # etc.
64+
65+
you can now use the following interface for much Python 2/3 compatible code::
66+
67+
>>> # Alias for future.builtins on Py2:
68+
>>> from builtins import str, open, range, dict
69+
70+
>>> # Alias for future.moves.* on Py2:
71+
>>> import queue
72+
>>> import configparser
73+
>>> import tkinter.dialog
74+
>>> etc.
75+
76+
Notice that the above code will run on Python 3 even without the presence of the
77+
``future`` package. Of the 44 standard library modules that were refactored with
78+
PEP 3108, 30 are supported with direct imports in this manner. (These are listed
79+
here: :ref:`direct-imports`.)
80+
81+
The other 14 standard library modules that kept the same top-level names in
82+
Py3.x are not supported with this direct import interface on Py2. These include
83+
the 5 modules in the Py3 ``urllib`` package. These modules are accessible through
84+
the following interface (as well as the interfaces offered in previous versions
85+
of ``python-future``)::
86+
87+
from future.standard_library import install_aliases
88+
install_aliases()
89+
90+
from collections import UserDict, UserList, UserString
91+
import dbm.gnu
92+
from itertools import filterfalse, zip_longest
93+
from subprocess import getoutput, getstatusoutput
94+
from sys import intern
95+
import test.support
96+
from urllib.request import urlopen
97+
from urllib.parse import urlparse
98+
# etc.
99+
from collections import Counter, OrderedDict # backported to Py2.6
100+
101+
The complete list of packages supported with this interface is here:
102+
:ref:`list-standard-library-refactored`.
103+
104+
For more information on these and other interfaces to the standard library, see
105+
:ref:`standard-library-imports`.
106+
107+
Bug fixes
108+
---------
109+
110+
- This release expands the ``future.moves`` package to include most of the remaining
111+
modules that were moved in the standard library reorganization (PEP 3108).
112+
(Issue #104).
113+
114+
- This release also removes the broken ``--doctests_only`` option from the ``futurize``
115+
and ``pasteurize`` scripts for now (issue #103).
116+
117+
Internal cleanups
118+
-----------------
119+
120+
The project folder structure has changed. Top-level packages are now in a
121+
``src`` folder and the tests have been moved into a project-level ``tests``
122+
folder.
123+
124+
The following deprecated internal modules have been removed (issue #80):
125+
126+
- ``future.utils.encoding`` and ``future.utils.six``.
127+
128+
Deprecations
129+
------------
130+
131+
The following internal functions have been deprecated and will be removed in a future release:
132+
133+
- ``future.standard_library.scrub_py2_sys_modules``
134+
- ``future.standard_library.scrub_future_sys_modules``
135+
136+
8137
.. _whats-new-0.13.x:
9138

10139
Changes in version 0.13.1 (2014-09-23)
@@ -19,8 +148,8 @@ This is a bug-fix release:
19148
- Doc formatting fix (issues #98, 100)
20149

21150

22-
Changes in version 0.13 (2014-08-13)
23-
====================================
151+
Changes in version 0.13.0 (2014-08-13)
152+
======================================
24153

25154
This is mostly a clean-up release. It adds some small new compatibility features
26155
and fixes several bugs.
@@ -765,6 +894,13 @@ deprecated.
765894
Summary of all changes
766895
======================
767896

897+
v0.15.0:
898+
* Full backports of ``urllib.parse`` and other ``urllib`` submodules are exposed by ``install_aliases()``.
899+
* ``tkinter.ttk`` support
900+
* Initial ``surrogateescape`` support
901+
* Additional backports: ``collections``, ``http`` constants, etc.
902+
* Bug fixes
903+
768904
v0.14.3:
769905
* Bug fixes
770906

@@ -774,7 +910,7 @@ v0.14.2:
774910
v0.14.1:
775911
* Bug fixes
776912

777-
v0.14:
913+
v0.14.0:
778914
* New top-level ``builtins`` package on Py2 for cleaner imports. Equivalent to
779915
``future.builtins``
780916
* New top-level packages on Py2 with the same names as Py3 standard modules:

docs/compatible_idioms.rst

+29
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,33 @@ file()
952952
f = open(pathname, 'rb') # if f.read() should return bytes
953953
# or
954954
f = open(pathname, 'rt') # if f.read() should return unicode text
955+
exec
956+
~~~~
957+
958+
.. code:: python
959+
960+
# Python 2 only:
961+
exec 'x = 10'
962+
963+
# Python 2 and 3:
964+
exec('x = 10')
965+
.. code:: python
966+
967+
# Python 2 only:
968+
g = globals()
969+
exec 'x = 10' in g
970+
971+
# Python 2 and 3:
972+
g = globals()
973+
exec('x = 10', g)
974+
.. code:: python
975+
976+
# Python 2 only:
977+
l = locals()
978+
exec 'x = 10' in g, l
979+
980+
# Python 2 and 3:
981+
exec('x = 10', g, l)
955982
execfile()
956983
~~~~~~~~~~
957984

@@ -1340,6 +1367,7 @@ Tkinter
13401367
import tkFont
13411368
import tkMessageBox
13421369
import tkSimpleDialog
1370+
import ttk
13431371
13441372
# Python 2 and 3 (after ``pip install future``):
13451373
import tkinter
@@ -1356,6 +1384,7 @@ Tkinter
13561384
import tkinter.font
13571385
import tkinter.messagebox
13581386
import tkinter.simpledialog
1387+
import tkinter.ttk
13591388
socketserver
13601389
~~~~~~~~~~~~
13611390

0 commit comments

Comments
 (0)