Skip to content

Commit d7e4722

Browse files
committed
Docs: minor tweaks
1 parent fd44b5e commit d7e4722

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

docs/dict_object.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ stick with standard Python 3 code in your Py2/3 compatible codebase::
2222
for value in d.values():
2323
# code here
2424

25-
In this case there will be memory overhead of list creation for each call to
26-
``items``, ``values`` or ``keys``.
25+
In this case there will be memory overhead of list creation on Py2 for each
26+
call to ``items``, ``values`` or ``keys``.
2727

2828
For improved efficiency, ``future.builtins`` (aliased to ``builtins``) provides
2929
a Python 2 ``dict`` subclass whose :func:`keys`, :func:`values`, and
@@ -70,7 +70,7 @@ The memory-efficient (and CPU-efficient) alternatives are:
7070
- to construct a dictionary from an iterator. The above line could use a
7171
generator like this::
7272

73-
d = dict((i, i**2) for i in range(10**7)
73+
d = dict((i, i**2) for i in range(10**7))
7474

7575
- to construct an empty dictionary with a ``dict()`` call using
7676
``builtins.dict`` (rather than ``{}``) and then update it;

docs/isinstance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ the types from ``future`` to their native superclasses on Py2.
6969
The ``native`` function in ``future.utils`` is provided for this. Here is how
7070
to use it. (The output showing is from Py2)::
7171

72-
>>> from builtins import *
72+
>>> from builtins import int, bytes, str
7373
>>> from future.utils import native
7474

7575
>>> a = int(10**20) # Py3-like long int

docs/open_function.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ contents as (unicode) strings unless the binary (``b``) flag is passed, as in::
1010

1111
in which case its methods like :func:`read` return Py3 :class:`bytes` objects.
1212

13-
On Py2, ``future.builtins`` (and ``builtins``) provides an ``open`` function
14-
that is mostly compatible with that on Python 3 (e.g. it offers keyword
15-
arguments like ``encoding``). This maps to the ``open`` backport available in
16-
the standard library :mod:`io` module on Py2.6 and Py2.7.
13+
On Py2 with ``future`` installed, the :mod:`builtins` module provides an
14+
``open`` function that is mostly compatible with that on Python 3 (e.g. it
15+
offers keyword arguments like ``encoding``). This maps to the ``open`` backport
16+
available in the standard library :mod:`io` module on Py2.6 and Py2.7.
1717

1818
One difference to be aware of between the Python 3 ``open`` and
1919
``future.builtins.open`` on Python 2 is that the return types of methods such

docs/quickstart.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ The easiest way is to start each new module with these lines::
4040
from builtins import *
4141

4242
Then write standard Python 3 code. The :mod:`future` package will
43-
provide support for running your code on Python 2.6 and 2.7 mostly unchanged.
43+
provide support for running your code on Python 2.6, 2.7, and 3.3+ mostly
44+
unchanged.
4445

4546
- For explicit import forms, see :ref:`explicit-imports`.
4647
- For more details, see :ref:`what-else`.

0 commit comments

Comments
 (0)