@@ -8,10 +8,71 @@ the standard Python 3 names and locations, it provides access to either the
88corresponding native standard library modules (``future.moves ``) or to backported
99modules from Python 3.3 (``future.backports ``).
1010
11+ .. _list-standard-library-moves :
12+
13+ List of moved standard library modules
14+ --------------------------------------
15+
16+ The complete list of modules available via one of the interfaces below is::
17+
18+ from collections import Counter, OrderedDict # backported to Py2.6
19+ from collections import UserList, UserDict
20+
21+ import configparser
22+ import copyreg
23+
24+ import dbm
25+ import dbm.dumb
26+ import dbm.gnu
27+ import dbm.ndbm
28+
29+ from itertools import filterfalse, zip_longest
30+
31+ import html
32+ import html.entities
33+ import html.parser
34+
35+ import http
36+ import http.client
37+ import http.cookies
38+ import http.cookiejar
39+ import http.server
40+
41+ import queue
42+
43+ import socketserver
44+
45+ from subprocess import check_output # backported to Py2.6
46+ from subprocess import getoutput, getstatusoutput
47+
48+ from sys import intern
49+
50+ import urllib.error
51+ import urllib.parse
52+ import urllib.request
53+ import urllib.response
54+ import urllib.robotparser
55+
56+ import winreg # Windows only
57+
58+ import xmlrpc.client
59+ import xmlrpc.server
60+
61+ import _dummy_thread
62+ import _markupbase
63+ import _thread
64+
65+ .. Disabled: import test.support
66+
67+
68+
69+ Interfaces
70+ ----------
71+
1172There are currently four interfaces to the reorganized standard library.
1273
1374Context-manager interface
14- -------------------------
75+ ~~~~~~~~~~~~~~~~~~~~~~~~~
1576
1677The recommended interface is via a context-manager called ``hooks ``::
1778
@@ -29,7 +90,7 @@ The recommended interface is via a context-manager called ``hooks``::
2990 # and other moved modules and definitions
3091
3192Direct interface
32- ----------------
93+ ~~~~~~~~~~~~~~~~
3394
3495The second interface avoids import hooks. It may therefore be more
3596robust, at the cost of less idiomatic code. Use it as follows::
@@ -53,7 +114,7 @@ One workaround is to replace the dot with an underscore::
53114 import future.moves.http.client as http_client
54115
55116``import_ `` and ``from_import `` functions
56- -----------------------------------------
117+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57118
58119A third interface, which also works with two-level imports, is to use the
59120``import_ `` and ``from_import `` functions from ``future.standard_library `` as
@@ -67,7 +128,7 @@ follows::
67128 urlopen, urlsplit = from_import('urllib.request', 'urlopen', 'urlsplit')
68129
69130install_hooks() call
70- --------------------
131+ ~~~~~~~~~~~~~~~~~~~~
71132
72133The fourth interface to the reorganized standard library is via an
73134explicit call to ``install_hooks() ``::
@@ -114,39 +175,6 @@ modules on Py2::
114175.. but it has the advantage that it can be used by automatic translation scripts such as ``futurize`` and ``pasteurize``.
115176
116177
117- List of standard library modules
118- --------------------------------
119-
120- The complete list of modules available via one of the four interfaces above is::
121-
122- import socketserver
123- import queue
124- import configparser
125- from collections import UserList
126- from collections import Counter, OrderedDict # backported to Py2.6
127- from itertools import filterfalse, zip_longest
128-
129- import html
130- import html.entities
131- import html.parser
132-
133- import http
134- import http.client
135- import http.server
136- import http.cookies
137- import http.cookiejar
138-
139- import urllib
140- import urllib.parse
141- import urllib.request
142- import urllib.error
143-
144- import xmlrpc.client
145- import xmlrpc.server
146-
147- .. Disabled: import test.support
148-
149-
150178 Comparing future.moves and six.moves
151179------------------------------------
152180
0 commit comments