|
Original |
Translation |
|
37
|
Wraps :func:`filter` usage in a :class:`list` call.
|
|
|
38
|
Fixes function attributes that have been renamed. For example, ``my_function.func_closure`` is converted to ``my_function.__closure__``.
|
|
|
39
|
Removes ``from __future__ import new_feature`` statements.
|
|
|
40
|
Renames :func:`os.getcwdu` to :func:`os.getcwd`.
|
|
|
41
|
|
42
|
This optional fixer performs several transformations that make Python code more idiomatic. Type comparisons like ``type(x) is SomeClass`` and ``type(x) == SomeClass`` are converted to ``isinstance(x, SomeClass)``. ``while 1`` becomes ``while True``. This fixer also tries to make use of :func:`sorted` in appropriate places. For example, this block ::
|
|
|
43
|
L = list(some_iterable) L.sort()
|
|
|
44
|
|
|
|
45
|
L = sorted(some_iterable)
|
|
|
46
|
Detects sibling imports and converts them to relative imports.
|
|