@@ -55,13 +55,13 @@ The `six project`_ provides the ``six`` module which contains various tidbits in
55
55
helping to support Python 2/3 code. All ``six ``-related fixers assume the latest
56
56
version of ``six `` is installed.
57
57
58
- .. 2to3fixer :: basestring
58
+ .. attribute :: basestring
59
59
60
60
Replaces all references to :func: `basestring ` with :data: `six.string_types `.
61
61
62
62
.. versionadded :: 0.4
63
63
64
- .. 2to3fixer :: dict_six
64
+ .. attribute :: dict_six
65
65
66
66
Fixes various methods on the ``dict `` type for getting all keys, values, or
67
67
items. E.g.::
@@ -79,13 +79,13 @@ version of ``six`` is installed.
79
79
Care is taken to only call ``list() `` when not in an iterating context
80
80
(e.g. not the iterable for a ``for `` loop).
81
81
82
- .. 2to3fixer :: filter
82
+ .. attribute :: filter
83
83
84
84
When a call to :func: `filter <python2:filter> ` is discovered, ``from six.moves import filter `` is
85
85
added to the module. Wrapping the use in a call to ``list() `` is done when
86
86
necessary.
87
87
88
- .. 2to3fixer :: imports_six
88
+ .. attribute :: imports_six
89
89
90
90
Uses :mod: `six.moves ` to fix various renamed modules, e.g.::
91
91
@@ -139,7 +139,7 @@ version of ``six`` is installed.
139
139
140
140
.. versionadded :: 0.4
141
141
142
- .. 2to3fixer :: input_six
142
+ .. attribute :: input_six
143
143
144
144
Changes::
145
145
@@ -154,18 +154,18 @@ version of ``six`` is installed.
154
154
155
155
.. versionadded :: 0.4
156
156
157
- .. 2to3fixer :: int_long_tuple
157
+ .. attribute :: int_long_tuple
158
158
159
159
Changes ``(int, long) `` or ``(long, int) `` to :data: `six.integer_types `.
160
160
161
161
.. versionadded :: 0.4
162
162
163
- .. 2to3fixer :: map
163
+ .. attribute :: map
164
164
165
165
If a call to :func: `map <python2:map> ` is discovered, ``from six.moves import map `` is added to
166
166
the module. Wrapping the use in a call to ``list() `` is done when necessary.
167
167
168
- .. 2to3fixer :: metaclass
168
+ .. attribute :: metaclass
169
169
170
170
Changes::
171
171
@@ -181,16 +181,16 @@ version of ``six`` is installed.
181
181
.. seealso ::
182
182
:func: `six.with_metaclass `
183
183
184
- .. 2to3fixer :: raise_six
184
+ .. attribute :: raise_six
185
185
186
186
Changes ``raise E, V, T `` to ``six.reraise(E, V, T) ``.
187
187
188
- .. 2to3fixer :: unicode_type
188
+ .. attribute :: unicode_type
189
189
190
190
Changes all reference of :func: `unicode <python2:unicode> ` to
191
191
:data: `six.text_type `.
192
192
193
- .. 2to3fixer :: urllib_six
193
+ .. attribute :: urllib_six
194
194
195
195
Changes::
196
196
@@ -202,12 +202,12 @@ version of ``six`` is installed.
202
202
from six.moves.urllib.parse import quote_plus
203
203
quote_plus('hello world')
204
204
205
- .. 2to3fixer :: unichr
205
+ .. attribute :: unichr
206
206
207
207
Changes all reference of :func: `unichr <python2:unichr> ` to
208
208
:data: `six.unichr `.
209
209
210
- .. 2to3fixer :: xrange_six
210
+ .. attribute :: xrange_six
211
211
212
212
Changes::
213
213
@@ -223,7 +223,7 @@ version of ``six`` is installed.
223
223
Care is taken not to call ``list() `` when ``range() `` is used in an iterating
224
224
context.
225
225
226
- .. 2to3fixer :: zip
226
+ .. attribute :: zip
227
227
228
228
If :func: `zip <python2:zip> ` is called, ``from six.moves import zip `` is added to the module.
229
229
Wrapping the use in a call to ``list() `` is done when necessary.
@@ -236,57 +236,57 @@ Some :doc:`fixers from fissix <fissix:fixers>`
236
236
in Python's standard library are run by default unmodified as their
237
237
transformations are Python 2 compatible.
238
238
239
- - :2to3fixer : `apply <python :apply> `
240
- - :2to3fixer : `except <python :except> `
241
- - :2to3fixer : `exec <python :exec> `
242
- - :2to3fixer : `execfile <python :execfile> `
243
- - :2to3fixer : `exitfunc <python :exitfunc> `
244
- - :2to3fixer : `funcattrs <python :funcattrs> `
245
- - :2to3fixer : `has_key <python :has_key> `
246
- - :2to3fixer : `idioms <python :idioms> `
247
- - :2to3fixer : `long <python :long> `
248
- - :2to3fixer : `methodattrs <python :methodattrs> `
249
- - :2to3fixer : `ne <python :ne> `
250
- - :2to3fixer : `numliterals <python :numliterals> `
251
- - :2to3fixer : `operator <python :operator> `
252
- - :2to3fixer : `paren <python :paren> `
253
- - :2to3fixer : `reduce <python :reduce> `
254
- - :2to3fixer : `repr <python :repr> `
255
- - :2to3fixer : `set_literal <python :set_literal> `
256
- - :2to3fixer : `standarderror <python :standarderror> `
257
- - :2to3fixer : `sys_exc <python :sys_exc> `
258
- - :2to3fixer : `throw <python :throw> `
259
- - :2to3fixer : `tuple_params <python :tuple_params> `
260
- - :2to3fixer : `types <python :types> `
261
- - :2to3fixer : `ws_comma <python :ws_comma> `
262
- - :2to3fixer : `xreadlines <python :xreadlines> `
239
+ - :attr : `apply <fissix :apply> `
240
+ - :attr : `except <fissix :except> `
241
+ - :attr : `exec <fissix :exec> `
242
+ - :attr : `execfile <fissix :execfile> `
243
+ - :attr : `exitfunc <fissix :exitfunc> `
244
+ - :attr : `funcattrs <fissix :funcattrs> `
245
+ - :attr : `has_key <fissix :has_key> `
246
+ - :attr : `idioms <fissix :idioms> `
247
+ - :attr : `long <fissix :long> `
248
+ - :attr : `methodattrs <fissix :methodattrs> `
249
+ - :attr : `ne <fissix :ne> `
250
+ - :attr : `numliterals <fissix :numliterals> `
251
+ - :attr : `operator <fissix :operator> `
252
+ - :attr : `paren <fissix :paren> `
253
+ - :attr : `reduce <fissix :reduce> `
254
+ - :attr : `repr <fissix :repr> `
255
+ - :attr : `set_literal <fissix :set_literal> `
256
+ - :attr : `standarderror <fissix :standarderror> `
257
+ - :attr : `sys_exc <fissix :sys_exc> `
258
+ - :attr : `throw <fissix :throw> `
259
+ - :attr : `tuple_params <fissix :tuple_params> `
260
+ - :attr : `types <fissix :types> `
261
+ - :attr : `ws_comma <fissix :ws_comma> `
262
+ - :attr : `xreadlines <fissix :xreadlines> `
263
263
264
264
Fixers with no dependencies
265
265
+++++++++++++++++++++++++++
266
266
267
- .. 2to3fixer :: file
267
+ .. attribute :: file
268
268
269
269
Changes all calls to :func: `file <python2:file> ` to :func: `open <python2:open> `.
270
270
271
271
.. versionadded :: 0.4
272
272
273
- .. 2to3fixer :: import
273
+ .. attribute :: import
274
274
275
275
Changes implicit relative imports to explicit relative imports and adds
276
276
``from __future__ import absolute_import ``.
277
277
278
278
.. versionadded :: 0.4
279
279
280
- .. 2to3fixer :: next
280
+ .. attribute :: next
281
281
282
282
Changes all method calls from ``x.next() `` to ``next(x) ``.
283
283
284
- .. 2to3fixer :: print
284
+ .. attribute :: print
285
285
286
286
Changes all usage of the ``print `` statement to use the :func: `print ` function
287
287
and adds ``from __future__ import print_function ``.
288
288
289
- .. 2to3fixer :: raise
289
+ .. attribute :: raise
290
290
291
291
Changes comma-based ``raise `` statements from::
292
292
@@ -307,7 +307,7 @@ to specify the ``-f default`` or ``--fix=default`` option, e.g.::
307
307
308
308
python -m modernize -f default -f libmodernize.fixes.fix_open
309
309
310
- .. 2to3fixer :: classic_division
310
+ .. attribute :: classic_division
311
311
312
312
When a use of the division operator -- ``/ `` -- is found, add
313
313
``from __future__ import division `` and change the operator to ``// ``.
@@ -328,7 +328,7 @@ to specify the ``-f default`` or ``--fix=default`` option, e.g.::
328
328
329
329
.. versionadded :: 1.0
330
330
331
- .. 2to3fixer :: open
331
+ .. attribute :: open
332
332
333
333
When a call to :func: `open <python2:open> ` is discovered, add ``from io import open `` at the top
334
334
of the module so as to use :func: `io.open ` instead. This fixer is opt-in because it
0 commit comments