Skip to content

Commit fc0b300

Browse files
committed
Update docs
1 parent dac6ea8 commit fc0b300

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

docs/quickstart.rst

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,30 +98,36 @@ be accessed under their Python 3 names and locations in Python 2::
9898
import http.cookies
9999
import http.cookiejar
100100

101+
import urllib.request
102+
import urllib.parse
103+
import urllib.response
104+
import urllib.error
105+
import urllib.robotparser
106+
101107
import xmlrpc.client
102108
import xmlrpc.server
103109

104-
``urllib`` currently requires an explicit import because the name clashes with
105-
that on Python 2 and because Python's syntax does not allow imports of this
106-
form with a dotted module name after ``as``::
107-
108-
import future.moves.urllib.parse as urllib.parse
109-
110-
For submodules of ``urllib`` and other packages (like ``http``), this
111-
alternative form is available::
112-
113-
from future.standard_library import import_
114-
115-
urllib = import_('urllib')
116-
import_('urllib.parse')
117-
import_('urllib.request')
118-
import_('urllib.error')
119-
120-
response = urllib.request.urlopen('http://mywebsite.com')
121-
# etc.
122-
123-
For an explanation of these and other forms of imports from the standard
124-
library, see :ref:`standard-library-imports`.
110+
.. ``urllib`` currently requires an explicit import because the name clashes with
111+
.. that on Python 2 and because Python's syntax does not allow imports of this
112+
.. form with a dotted module name after ``as``::
113+
..
114+
.. import future.moves.urllib.parse as urllib.parse
115+
..
116+
.. For submodules of ``urllib`` and other packages (like ``http``), this
117+
.. alternative form is available::
118+
..
119+
.. from future.standard_library import import_
120+
..
121+
.. urllib = import_('urllib')
122+
.. import_('urllib.parse')
123+
.. import_('urllib.request')
124+
.. import_('urllib.error')
125+
..
126+
.. response = urllib.request.urlopen('http://mywebsite.com')
127+
.. # etc.
128+
..
129+
.. For an explanation of these and other forms of imports from the standard
130+
.. library, see :ref:`standard-library-imports`.
125131
126132
127133
.. _py2-dependencies:

docs/whatsnew.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Many small improvements and fixes have been made across the project. Some highli
243243

244244
- ``futurize``: Shebang lines such as ``#!/usr/bin/env python`` and source code
245245
file encoding declarations like ``# -*- coding=utf-8 -*-`` are no longer occasionally
246-
displaced by ``from __future__ import ...`` statements.
246+
displaced by ``from __future__ import ...`` statements. (Issue #10.)
247247

248248
- Improved compatibility with py2exe (`issue #31 <https://github.com/PythonCharmers/python-future/issues/31>`_).
249249

future/__init__.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
2. It allows you to use a single, clean Python 3.x-compatible codebase to
77
support both Python 3 and Python 2 with minimal overhead.
88
9-
Notable projects that use ``future`` for Python 2/3 compatibility are `Mezzanine <http://mezzanine.jupo.org/>`_ and `xlwt-future <https://pypi.python.org/pypi/xlwt-future>`_.
9+
Notable projects that use ``future`` for Python 2/3 compatibility are
10+
`Mezzanine <http://mezzanine.jupo.org/>`_ and `ObsPy <http://obspy.org>`_.
1011
1112
It is designed to be used as follows::
1213
1314
from __future__ import (absolute_import, division,
1415
print_function, unicode_literals)
15-
from future.builtins import (bytes, dict, int, range, str,
16-
ascii, chr, hex, input, next,
17-
oct, open, pow, round, super,
18-
filter, map, zip)
16+
from future.builtins import (
17+
bytes, dict, int, list, object, range, str,
18+
ascii, chr, hex, input, next, oct, open,
19+
pow, round, super,
20+
filter, map, zip)
1921
2022
followed by predominantly standard, idiomatic Python 3 code that then runs
2123
similarly on Python 2.6/2.7 and Python 3.3+.
@@ -48,12 +50,6 @@
4850
4951
See: http://python-future.org
5052
51-
Also see the docstrings for each of these modules for more info::
52-
53-
- future.standard_library
54-
- future.builtins
55-
- future.utils
56-
5753
5854
Credits
5955
-------

0 commit comments

Comments
 (0)