Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 677dc71

Browse files
committed
Branch merge
2 parents 6c78de5 + 793c47a commit 677dc71

32 files changed

Lines changed: 226 additions & 280 deletions

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Process-wide parameters
122122
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
123123
returned string points into static storage; the caller should not modify its
124124
value. This corresponds to the :makevar:`prefix` variable in the top-level
125-
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
125+
:file:`Makefile` and the ``--prefix`` argument to the :program:`configure`
126126
script at build time. The value is available to Python code as ``sys.prefix``.
127127
It is only useful on Unix. See also the next function.
128128

@@ -135,7 +135,7 @@ Process-wide parameters
135135
program name is ``'/usr/local/bin/python'``, the exec-prefix is
136136
``'/usr/local'``. The returned string points into static storage; the caller
137137
should not modify its value. This corresponds to the :makevar:`exec_prefix`
138-
variable in the top-level :file:`Makefile` and the :option:`--exec-prefix`
138+
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
139139
argument to the :program:`configure` script at build time. The value is
140140
available to Python code as ``sys.exec_prefix``. It is only useful on Unix.
141141

Doc/documenting/markup.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ in a different style:
513513

514514
.. describe:: keyword
515515

516-
The name of a keyword in Python.
516+
The name of a Python keyword. Using this role will generate a link to the
517+
documentation of the keyword. ``True``, ``False`` and ``None`` do not use
518+
this role, but simple code markup (````True````), given that they're
519+
fundamental to the language and should be known to any programmer.
517520

518521
.. describe:: mailheader
519522

Doc/faq/design.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ construction of large programs.
667667
Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes
668668
(ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check
669669
whether an instance or a class implements a particular ABC. The
670-
:mod:`collections` modules defines a set of useful ABCs such as
670+
:mod:`collections.abc` module defines a set of useful ABCs such as
671671
:class:`Iterable`, :class:`Container`, and :class:`MutableMapping`.
672672

673673
For Python, many of the advantages of interface specifications can be obtained

Doc/faq/programming.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,6 @@ calling another function by using ``*`` and ``**``::
473473
...
474474
g(x, *args, **kwargs)
475475

476-
In the unlikely case that you care about Python versions older than 2.0, use
477-
:func:`apply`::
478-
479-
def f(x, *args, **kwargs):
480-
...
481-
kwargs['width'] = '14.3c'
482-
...
483-
apply(g, (x,)+args, kwargs)
484-
485476

486477
How do I write a function with output parameters (call by reference)?
487478
---------------------------------------------------------------------

Doc/faq/windows.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ with multithreading-DLL options (``/MD``).
543543

544544
If you can't change compilers or flags, try using :c:func:`Py_RunSimpleString`.
545545
A trick to get it to run an arbitrary file is to construct a call to
546-
:func:`execfile` with the name of your file as argument.
546+
:func:`exec` and :func:`open` with the name of your file as argument.
547547

548548
Also note that you can not mix-and-match Debug and Release versions. If you
549-
wish to use the Debug Multithreaded DLL, then your module *must* have an "_d"
549+
wish to use the Debug Multithreaded DLL, then your module *must* have ``_d``
550550
appended to the base name.
551551

552552

Doc/glossary.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ Glossary
434434

435435
mapping
436436
A container object that supports arbitrary key lookups and implements the
437-
methods specified in the :class:`~collections.Mapping` or
438-
:class:`~collections.MutableMapping`
437+
methods specified in the :class:`~collections.abc.Mapping` or
438+
:class:`~collections.abc.MutableMapping`
439439
:ref:`abstract base classes <collections-abstract-base-classes>`. Examples
440440
include :class:`dict`, :class:`collections.defaultdict`,
441441
:class:`collections.OrderedDict` and :class:`collections.Counter`.
@@ -492,7 +492,7 @@ Glossary
492492
:func:`builtins.open` and :func:`os.open` are distinguished by their
493493
namespaces. Namespaces also aid readability and maintainability by making
494494
it clear which module implements a function. For instance, writing
495-
:func:`random.seed` or :func:`itertools.izip` makes it clear that those
495+
:func:`random.seed` or :func:`itertools.islice` makes it clear that those
496496
functions are implemented by the :mod:`random` and :mod:`itertools`
497497
modules, respectively.
498498

Doc/howto/logging.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,10 @@ With the logger object configured, the following methods create log messages:
412412
:meth:`Logger.error`, and :meth:`Logger.critical` all create log records with
413413
a message and a level that corresponds to their respective method names. The
414414
message is actually a format string, which may contain the standard string
415-
substitution syntax of :const:`%s`, :const:`%d`, :const:`%f`, and so on. The
415+
substitution syntax of ``%s``, ``%d``, ``%f``, and so on. The
416416
rest of their arguments is a list of objects that correspond with the
417-
substitution fields in the message. With regard to :const:`**kwargs`, the
418-
logging methods care only about a keyword of :const:`exc_info` and use it to
417+
substitution fields in the message. With regard to ``**kwargs``, the
418+
logging methods care only about a keyword of ``exc_info`` and use it to
419419
determine whether to log exception information.
420420

421421
* :meth:`Logger.exception` creates a log message similar to

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ ArgumentParser objects
155155
conflicting optionals.
156156

157157
* prog_ - The name of the program (default:
158-
:data:`sys.argv[0]`)
158+
``sys.argv[0]``)
159159

160160
* usage_ - The string describing the program usage (default: generated)
161161

Doc/library/base64.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ The modern interface provides:
4545
at least length 2 (additional characters are ignored) which specifies the
4646
alternative alphabet used instead of the ``+`` and ``/`` characters.
4747

48-
The decoded string is returned. A `binascii.Error` is raised if *s* is
49-
incorrectly padded.
48+
The decoded string is returned. A :exc:`binascii.Error` exception is raised
49+
if *s* is incorrectly padded.
5050

5151
If *validate* is ``False`` (the default), non-base64-alphabet characters are
5252
discarded prior to the padding check. If *validate* is ``True``,

Doc/library/configparser.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,17 +806,17 @@ To get interpolation, use :class:`ConfigParser`::
806806
cfg = configparser.ConfigParser()
807807
cfg.read('example.cfg')
808808

809-
# Set the optional `raw` argument of get() to True if you wish to disable
809+
# Set the optional *raw* argument of get() to True if you wish to disable
810810
# interpolation in a single get operation.
811811
print(cfg.get('Section1', 'foo', raw=False)) # -> "Python is fun!"
812812
print(cfg.get('Section1', 'foo', raw=True)) # -> "%(bar)s is %(baz)s!"
813813

814-
# The optional `vars` argument is a dict with members that will take
814+
# The optional *vars* argument is a dict with members that will take
815815
# precedence in interpolation.
816816
print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',
817817
'baz': 'evil'}))
818818

819-
# The optional `fallback` argument can be used to provide a fallback value
819+
# The optional *fallback* argument can be used to provide a fallback value
820820
print(cfg.get('Section1', 'foo'))
821821
# -> "Python is fun!"
822822

0 commit comments

Comments
 (0)