Skip to content

Commit b3ebb43

Browse files
committed
doc: Fix indentation errors/warnings.
1 parent 5ce4048 commit b3ebb43

File tree

6 files changed

+52
-40
lines changed

6 files changed

+52
-40
lines changed

docs/changelog.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,19 +463,19 @@ v0.11.4:
463463

464464
v0.11.3:
465465
* The ``futurize`` and ``pasteurize`` scripts add an explicit call to
466-
``future.standard_library.install_hooks()`` whenever modules affected by PEP
467-
3108 are imported.
466+
``future.standard_library.install_hooks()`` whenever modules affected by
467+
PEP 3108 are imported.
468468

469469
* The ``future.builtins.bytes`` constructor now accepts ``frozenset``
470-
objects as on Py3.
470+
objects as on Py3.
471471

472472
v0.11.2:
473473
* The ``past.autotranslate`` feature now finds modules to import more
474-
robustly and works with Python eggs.
474+
robustly and works with Python eggs.
475475

476476
v0.11.1:
477477
* Update to ``requirements_py26.txt`` for Python 2.6. Small updates to
478-
docs and tests.
478+
docs and tests.
479479

480480
v0.11:
481481
* New ``past`` package with ``past.builtins`` and ``past.translation``

docs/roadmap.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ futurize script
55
---------------
66

77
1. "Safe" mode -- from Py2 to modern Py2 or Py3 to more-compatible Py3
8+
89
- Split the fixers into two categories: safe and bold
910
- Safe is highly unlikely to break existing Py2 or Py3 support. The
1011
output of this still requires :mod:`future` imports. Examples:
11-
- Compatible metaclass syntax on Py3
12-
- Explicit inheritance from object on Py3
12+
13+
- Compatible metaclass syntax on Py3
14+
- Explicit inheritance from object on Py3
1315

1416
- Bold might make assumptions about which strings on Py2 should be
1517
unicode strings and which should be bytestrings.
18+
1619
- We should also build up a database of which standard library
1720
interfaces on Py2 and Py3 accept unicode strings versus
1821
byte-strings, which have changed, and which haven't.

docs/why_python3.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Why are Unicode strings better on Python 3?
1919
-------------------------------------------
2020

2121
- it is not the default string type (you have to prefix the string
22-
with a u to get Unicode);
22+
with a u to get Unicode);
2323

2424
- it is missing some functionality, e.g. casefold;
2525

@@ -30,7 +30,7 @@ with a u to get Unicode);
3030
- narrow builds take up to two times more memory per string as needed;
3131

3232
- worse, narrow builds have very naive (possibly even "broken")
33-
handling of code points in the Supplementary Multilingual Planes.
33+
handling of code points in the Supplementary Multilingual Planes.
3434

3535
The unicode string type in Python 3 is better because:
3636

@@ -39,10 +39,10 @@ The unicode string type in Python 3 is better because:
3939
- it includes more functionality;
4040

4141
- starting in Python 3.3, it gets rid of the distinction between
42-
narrow and wide builds;
42+
narrow and wide builds;
4343

4444
- which reduces the memory overhead of strings by up to a factor
45-
of four in many cases;
45+
of four in many cases;
4646

4747
- and fixes the issue of SMP code points.
4848

future/standard_library/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def scrub_py2_sys_modules():
389389
def scrub_future_sys_modules():
390390
"""
391391
On Py2 only: Removes any modules such as ``http`` and ``html.parser`` from
392-
the ``sys.modules`` cache. Such modules would confuse code such as this:
392+
the ``sys.modules`` cache. Such modules would confuse code such as this::
393393
394394
# PyChecker does something like this:
395395
try:
@@ -399,21 +399,22 @@ def scrub_future_sys_modules():
399399
finally:
400400
PY3 = True
401401
402-
or this:
402+
or this::
403403
404404
import urllib # We want this to pull in only the Py2 module
405405
# after scrub_future_sys_modules() has been called
406406
407-
or this:
407+
or this::
408408
409409
# Requests does this in requests/packages/urllib3/connection.py:
410410
try: # Python 3
411411
from http.client import HTTPConnection, HTTPException
412412
except ImportError:
413413
from httplib import HTTPConnection, HTTPException
414414
415-
This function removes items matching this spec from sys.modules:
416-
key: new_py3_module_name
415+
This function removes items matching this spec from sys.modules::
416+
417+
key: new_py3_module_name
417418
value: either future.backports module or py2 module with
418419
another name
419420
"""
@@ -742,7 +743,9 @@ def from_import(module_name, *symbol_names, **kwargs):
742743
and this on Py2:
743744
744745
>>> from future.moves.module_name import symbol_names[0], ...
746+
745747
or:
748+
746749
>>> from future.backports.module_name import symbol_names[0], ...
747750
748751
except that it also handles dotted module names such as ``http.client``.

future/types/newrange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class newrange(Sequence):
2828
"""
2929
Pure-Python backport of Python 3's range object. See `the CPython
3030
documentation for details:
31-
<http://docs.python.org/py3k/library/functions.html#range>`_
31+
<http://docs.python.org/py3k/library/functions.html#range>`_
3232
"""
3333

3434
def __init__(self, *args):

future/utils/__init__.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,38 @@
22
A selection of cross-compatible functions for Python 2 and 3.
33
44
These come from several sources:
5-
* Jinja2 (BSD licensed: see https://github.com/mitsuhiko/jinja2/blob/master/LICENSE
6-
* Pandas compatibility module pandas.compat
7-
* six.py by Benjamin Peterson
8-
* Django
5+
6+
* Jinja2 (BSD licensed: see
7+
https://github.com/mitsuhiko/jinja2/blob/master/LICENSE)
8+
* Pandas compatibility module pandas.compat
9+
* six.py by Benjamin Peterson
10+
* Django
911
1012
This exports useful functions for 2/3 compatible code that are not
1113
builtins on Python 3:
12-
* bind_method: binds functions to classes
13-
* ``native_str_to_bytes`` and ``bytes_to_native_str``
14-
* ``native_str``: always equal to the native platform string object (because
15-
this may be shadowed by imports from future.builtins)
16-
* lists: lrange(), lmap(), lzip(), lfilter()
17-
* iterable method compatibility: iteritems, iterkeys, itervalues
18-
* Uses the original method if available, otherwise uses items, keys, values.
19-
* types:
20-
* text_type: unicode in Python 2, str in Python 3
21-
* binary_type: str in Python 2, bythes in Python 3
22-
* string_types: basestring in Python 2, str in Python 3
23-
24-
* bchr(c):
25-
Take an integer and make a 1-character byte string
26-
* bord(c)
27-
Take the result of indexing on a byte string and make an integer
28-
* tobytes(s)
29-
Take a text string, a byte string, or a sequence of characters taken
30-
from a byte string, and make a byte string.
14+
15+
* bind_method: binds functions to classes
16+
* ``native_str_to_bytes`` and ``bytes_to_native_str``
17+
* ``native_str``: always equal to the native platform string object (because
18+
this may be shadowed by imports from future.builtins)
19+
* lists: lrange(), lmap(), lzip(), lfilter()
20+
* iterable method compatibility: iteritems, iterkeys, itervalues
21+
22+
* Uses the original method if available, otherwise uses items, keys, values.
23+
24+
* types:
25+
26+
* text_type: unicode in Python 2, str in Python 3
27+
* binary_type: str in Python 2, bythes in Python 3
28+
* string_types: basestring in Python 2, str in Python 3
29+
30+
* bchr(c):
31+
Take an integer and make a 1-character byte string
32+
* bord(c)
33+
Take the result of indexing on a byte string and make an integer
34+
* tobytes(s)
35+
Take a text string, a byte string, or a sequence of characters taken
36+
from a byte string, and make a byte string.
3137
3238
This module also defines a simple decorator called
3339
``python_2_unicode_compatible`` (from django.utils.encoding) which

0 commit comments

Comments
 (0)