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

Skip to content

Commit a2fe334

Browse files
committed
Issue #15527: fix docs, remove double parens by changing markup.
Patch by Serhiy Storchaka.
1 parent b79be95 commit a2fe334

9 files changed

Lines changed: 95 additions & 95 deletions

File tree

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ process and user.
450450

451451
.. function:: setpgrp()
452452

453-
Call the system call :c:func:`setpgrp` or :c:func:`setpgrp(0, 0)` depending on
453+
Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on
454454
which version is implemented (if any). See the Unix manual for the semantics.
455455

456456
Availability: Unix.

Doc/library/platform.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Cross Platform
3030
returned as strings.
3131

3232
Values that cannot be determined are returned as given by the parameter presets.
33-
If bits is given as ``''``, the :c:func:`sizeof(pointer)` (or
34-
:c:func:`sizeof(long)` on Python version < 1.5.2) is used as indicator for the
33+
If bits is given as ``''``, the ``sizeof(pointer)`` (or
34+
``sizeof(long)`` on Python version < 1.5.2) is used as indicator for the
3535
supported pointer size.
3636

3737
The function relies on the system's :file:`file` command to do the actual work.

Doc/whatsnew/2.0.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ encoding. Encodings are named by strings, such as ``'ascii'``, ``'utf-8'``,
166166
registering new encodings that are then available throughout a Python program.
167167
If an encoding isn't specified, the default encoding is usually 7-bit ASCII,
168168
though it can be changed for your Python installation by calling the
169-
:func:`sys.setdefaultencoding(encoding)` function in a customised version of
169+
``sys.setdefaultencoding(encoding)`` function in a customised version of
170170
:file:`site.py`.
171171

172172
Combining 8-bit and Unicode strings always coerces to Unicode, using the default
@@ -203,7 +203,7 @@ U+0660 is an Arabic number.
203203

204204
The :mod:`codecs` module contains functions to look up existing encodings and
205205
register new ones. Unless you want to implement a new encoding, you'll most
206-
often use the :func:`codecs.lookup(encoding)` function, which returns a
206+
often use the ``codecs.lookup(encoding)`` function, which returns a
207207
4-element tuple: ``(encode_func, decode_func, stream_reader, stream_writer)``.
208208

209209
* *encode_func* is a function that takes a Unicode string, and returns a 2-tuple
@@ -600,7 +600,7 @@ Python code is found to be improperly indented.
600600
Changes to Built-in Functions
601601
-----------------------------
602602

603-
A new built-in, :func:`zip(seq1, seq2, ...)`, has been added. :func:`zip`
603+
A new built-in, ``zip(seq1, seq2, ...)``, has been added. :func:`zip`
604604
returns a list of tuples where each tuple contains the i-th element from each of
605605
the argument sequences. The difference between :func:`zip` and ``map(None,
606606
seq1, seq2)`` is that :func:`map` pads the sequences with ``None`` if the
@@ -619,7 +619,7 @@ level, serial)`` For example, in a hypothetical 2.0.1beta1, ``sys.version_info``
619619
would be ``(2, 0, 1, 'beta', 1)``. *level* is a string such as ``"alpha"``,
620620
``"beta"``, or ``"final"`` for a final release.
621621

622-
Dictionaries have an odd new method, :meth:`setdefault(key, default)`, which
622+
Dictionaries have an odd new method, ``setdefault(key, default)``, which
623623
behaves similarly to the existing :meth:`get` method. However, if the key is
624624
missing, :meth:`setdefault` both returns the value of *default* as :meth:`get`
625625
would do, and also inserts it into the dictionary as the value for *key*. Thus,
@@ -1038,7 +1038,7 @@ Brian Gallew contributed OpenSSL support for the :mod:`socket` module. OpenSSL
10381038
is an implementation of the Secure Socket Layer, which encrypts the data being
10391039
sent over a socket. When compiling Python, you can edit :file:`Modules/Setup`
10401040
to include SSL support, which adds an additional function to the :mod:`socket`
1041-
module: :func:`socket.ssl(socket, keyfile, certfile)`, which takes a socket
1041+
module: ``socket.ssl(socket, keyfile, certfile)``, which takes a socket
10421042
object and returns an SSL socket. The :mod:`httplib` and :mod:`urllib` modules
10431043
were also changed to support ``https://`` URLs, though no one has implemented
10441044
FTP or SMTP over SSL.

Doc/whatsnew/2.1.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Each of these magic methods can return anything at all: a Boolean, a matrix, a
204204
list, or any other Python object. Alternatively they can raise an exception if
205205
the comparison is impossible, inconsistent, or otherwise meaningless.
206206

207-
The built-in :func:`cmp(A,B)` function can use the rich comparison machinery,
207+
The built-in ``cmp(A,B)`` function can use the rich comparison machinery,
208208
and now accepts an optional argument specifying which comparison operation to
209209
use; this is given as one of the strings ``"<"``, ``"<="``, ``">"``, ``">="``,
210210
``"=="``, or ``"!="``. If called without the optional third argument,
@@ -350,7 +350,7 @@ where this behaviour is undesirable, object caches being the most common one,
350350
and another being circular references in data structures such as trees.
351351

352352
For example, consider a memoizing function that caches the results of another
353-
function :func:`f(x)` by storing the function's argument and its result in a
353+
function ``f(x)`` by storing the function's argument and its result in a
354354
dictionary::
355355

356356
_cache = {}
@@ -656,7 +656,7 @@ New and Improved Modules
656656
use :mod:`ftplib` to retrieve files and then don't work from behind a firewall.
657657
It's deemed unlikely that this will cause problems for anyone, because Netscape
658658
defaults to passive mode and few people complain, but if passive mode is
659-
unsuitable for your application or network setup, call :meth:`set_pasv(0)` on
659+
unsuitable for your application or network setup, call ``set_pasv(0)`` on
660660
FTP objects to disable passive mode.
661661

662662
* Support for raw socket access has been added to the :mod:`socket` module,
@@ -666,7 +666,7 @@ New and Improved Modules
666666
for displaying timing profiles for Python programs, invoked when the module is
667667
run as a script. Contributed by Eric S. Raymond.
668668

669-
* A new implementation-dependent function, :func:`sys._getframe([depth])`, has
669+
* A new implementation-dependent function, ``sys._getframe([depth])``, has
670670
been added to return a given frame object from the current call stack.
671671
:func:`sys._getframe` returns the frame at the top of the call stack; if the
672672
optional integer argument *depth* is supplied, the function returns the frame

Doc/whatsnew/2.2.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ attributes of their own:
173173

174174
* :attr:`__doc__` is the attribute's docstring.
175175

176-
* :meth:`__get__(object)` is a method that retrieves the attribute value from
176+
* ``__get__(object)`` is a method that retrieves the attribute value from
177177
*object*.
178178

179-
* :meth:`__set__(object, value)` sets the attribute on *object* to *value*.
179+
* ``__set__(object, value)`` sets the attribute on *object* to *value*.
180180

181-
* :meth:`__delete__(object, value)` deletes the *value* attribute of *object*.
181+
* ``__delete__(object, value)`` deletes the *value* attribute of *object*.
182182

183183
For example, when you write ``obj.x``, the steps that Python actually performs
184184
are::
@@ -288,7 +288,7 @@ Following this rule, referring to :meth:`D.save` will return :meth:`C.save`,
288288
which is the behaviour we're after. This lookup rule is the same as the one
289289
followed by Common Lisp. A new built-in function, :func:`super`, provides a way
290290
to get at a class's superclasses without having to reimplement Python's
291-
algorithm. The most commonly used form will be :func:`super(class, obj)`, which
291+
algorithm. The most commonly used form will be ``super(class, obj)``, which
292292
returns a bound superclass object (not the actual class object). This form
293293
will be used in methods to call a method in the superclass; for example,
294294
:class:`D`'s :meth:`save` method would look like this::
@@ -301,7 +301,7 @@ will be used in methods to call a method in the superclass; for example,
301301
...
302302

303303
:func:`super` can also return unbound superclass objects when called as
304-
:func:`super(class)` or :func:`super(class1, class2)`, but this probably won't
304+
``super(class)`` or ``super(class1, class2)``, but this probably won't
305305
often be useful.
306306

307307

@@ -314,13 +314,13 @@ code more readable by automatically mapping an attribute access such as
314314
``obj.parent`` into a method call such as ``obj.get_parent``. Python 2.2 adds
315315
some new ways of controlling attribute access.
316316

317-
First, :meth:`__getattr__(attr_name)` is still supported by new-style classes,
317+
First, ``__getattr__(attr_name)`` is still supported by new-style classes,
318318
and nothing about it has changed. As before, it will be called when an attempt
319319
is made to access ``obj.foo`` and no attribute named ``foo`` is found in the
320320
instance's dictionary.
321321

322322
New-style classes also support a new method,
323-
:meth:`__getattribute__(attr_name)`. The difference between the two methods is
323+
``__getattribute__(attr_name)``. The difference between the two methods is
324324
that :meth:`__getattribute__` is *always* called whenever any attribute is
325325
accessed, while the old :meth:`__getattr__` is only called if ``foo`` isn't
326326
found in the instance's dictionary.
@@ -441,8 +441,8 @@ work, though it really should.
441441

442442
In Python 2.2, iteration can be implemented separately, and :meth:`__getitem__`
443443
methods can be limited to classes that really do support random access. The
444-
basic idea of iterators is simple. A new built-in function, :func:`iter(obj)`
445-
or ``iter(C, sentinel)``, is used to get an iterator. :func:`iter(obj)` returns
444+
basic idea of iterators is simple. A new built-in function, ``iter(obj)``
445+
or ``iter(C, sentinel)``, is used to get an iterator. ``iter(obj)`` returns
446446
an iterator for the object *obj*, while ``iter(C, sentinel)`` returns an
447447
iterator that will invoke the callable object *C* until it returns *sentinel* to
448448
signal that the iterator is done.
@@ -793,7 +793,7 @@ further details.
793793

794794
Another change is simpler to explain. Since their introduction, Unicode strings
795795
have supported an :meth:`encode` method to convert the string to a selected
796-
encoding such as UTF-8 or Latin-1. A symmetric :meth:`decode([*encoding*])`
796+
encoding such as UTF-8 or Latin-1. A symmetric ``decode([*encoding*])``
797797
method has been added to 8-bit strings (though not to Unicode strings) in 2.2.
798798
:meth:`decode` assumes that the string is in the specified encoding and decodes
799799
it, returning whatever is returned by the codec.
@@ -1203,7 +1203,7 @@ Some of the more notable changes are:
12031203
to an MBCS encoded string, as used by the Microsoft file APIs. As MBCS is
12041204
explicitly used by the file APIs, Python's choice of ASCII as the default
12051205
encoding turns out to be an annoyance. On Unix, the locale's character set is
1206-
used if :func:`locale.nl_langinfo(CODESET)` is available. (Windows support was
1206+
used if ``locale.nl_langinfo(CODESET)`` is available. (Windows support was
12071207
contributed by Mark Hammond with assistance from Marc-André Lemburg. Unix
12081208
support was added by Martin von Löwis.)
12091209

Doc/whatsnew/2.3.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ This produces the following output::
501501
ZeroDivisionError: integer division or modulo by zero
502502

503503
Slightly more advanced programs will use a logger other than the root logger.
504-
The :func:`getLogger(name)` function is used to get a particular log, creating
505-
it if it doesn't exist yet. :func:`getLogger(None)` returns the root logger. ::
504+
The ``getLogger(name)`` function is used to get a particular log, creating
505+
it if it doesn't exist yet. ``getLogger(None)`` returns the root logger. ::
506506

507507
log = logging.getLogger('server')
508508
...
@@ -721,10 +721,10 @@ module:
721721
objects to it. Additional built-in and frozen modules can be imported by an
722722
object added to this list.
723723

724-
Importer objects must have a single method, :meth:`find_module(fullname,
725-
path=None)`. *fullname* will be a module or package name, e.g. ``string`` or
724+
Importer objects must have a single method, ``find_module(fullname,
725+
path=None)``. *fullname* will be a module or package name, e.g. ``string`` or
726726
``distutils.core``. :meth:`find_module` must return a loader object that has a
727-
single method, :meth:`load_module(fullname)`, that creates and returns the
727+
single method, ``load_module(fullname)``, that creates and returns the
728728
corresponding module object.
729729

730730
Pseudo-code for Python's new import logic, therefore, looks something like this
@@ -932,7 +932,7 @@ Or use slice objects directly in subscripts::
932932
[0, 2, 4]
933933

934934
To simplify implementing sequences that support extended slicing, slice objects
935-
now have a method :meth:`indices(length)` which, given the length of a sequence,
935+
now have a method ``indices(length)`` which, given the length of a sequence,
936936
returns a ``(start, stop, step)`` tuple that can be passed directly to
937937
:func:`range`. :meth:`indices` handles omitted and out-of-bounds indices in a
938938
manner consistent with regular slices (and this innocuous phrase hides a welter
@@ -981,7 +981,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
981981
* Built-in types now support the extended slicing syntax, as described in
982982
section :ref:`section-slices` of this document.
983983

984-
* A new built-in function, :func:`sum(iterable, start=0)`, adds up the numeric
984+
* A new built-in function, ``sum(iterable, start=0)``, adds up the numeric
985985
items in the iterable object and returns their sum. :func:`sum` only accepts
986986
numbers, meaning that you can't use it to concatenate a bunch of strings.
987987
(Contributed by Alex Martelli.)
@@ -995,7 +995,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
995995
its index, now takes optional *start* and *stop* arguments to limit the search
996996
to only part of the list.
997997

998-
* Dictionaries have a new method, :meth:`pop(key[, *default*])`, that returns
998+
* Dictionaries have a new method, ``pop(key[, *default*])``, that returns
999999
the value corresponding to *key* and removes that key/value pair from the
10001000
dictionary. If the requested key isn't present in the dictionary, *default* is
10011001
returned if it's specified and :exc:`KeyError` raised if it isn't. ::
@@ -1017,7 +1017,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
10171017
{}
10181018
>>>
10191019

1020-
There's also a new class method, :meth:`dict.fromkeys(iterable, value)`, that
1020+
There's also a new class method, ``dict.fromkeys(iterable, value)``, that
10211021
creates a dictionary with keys taken from the supplied iterator *iterable* and
10221022
all values set to *value*, defaulting to ``None``.
10231023

@@ -1090,7 +1090,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
10901090
100 bytecodes, speeding up single-threaded applications by reducing the
10911091
switching overhead. Some multithreaded applications may suffer slower response
10921092
time, but that's easily fixed by setting the limit back to a lower number using
1093-
:func:`sys.setcheckinterval(N)`. The limit can be retrieved with the new
1093+
``sys.setcheckinterval(N)``. The limit can be retrieved with the new
10941094
:func:`sys.getcheckinterval` function.
10951095

10961096
* One minor but far-reaching change is that the names of extension types defined
@@ -1269,10 +1269,10 @@ complete list of changes, or look through the CVS logs for all the details.
12691269

12701270
* Previously the :mod:`doctest` module would only search the docstrings of
12711271
public methods and functions for test cases, but it now also examines private
1272-
ones as well. The :func:`DocTestSuite(` function creates a
1272+
ones as well. The :func:`DocTestSuite` function creates a
12731273
:class:`unittest.TestSuite` object from a set of :mod:`doctest` tests.
12741274

1275-
* The new :func:`gc.get_referents(object)` function returns a list of all the
1275+
* The new ``gc.get_referents(object)`` function returns a list of all the
12761276
objects referenced by *object*.
12771277

12781278
* The :mod:`getopt` module gained a new function, :func:`gnu_getopt`, that
@@ -1344,8 +1344,8 @@ complete list of changes, or look through the CVS logs for all the details.
13441344
documentation for details.
13451345
(Contributed by Raymond Hettinger.)
13461346

1347-
* Two new functions in the :mod:`math` module, :func:`degrees(rads)` and
1348-
:func:`radians(degs)`, convert between radians and degrees. Other functions in
1347+
* Two new functions in the :mod:`math` module, ``degrees(rads)`` and
1348+
``radians(degs)``, convert between radians and degrees. Other functions in
13491349
the :mod:`math` module such as :func:`math.sin` and :func:`math.cos` have always
13501350
required input values measured in radians. Also, an optional *base* argument
13511351
was added to :func:`math.log` to make it easier to compute logarithms for bases
@@ -1402,7 +1402,7 @@ complete list of changes, or look through the CVS logs for all the details.
14021402
and therefore faster performance. Setting the parser object's
14031403
:attr:`buffer_text` attribute to :const:`True` will enable buffering.
14041404

1405-
* The :func:`sample(population, k)` function was added to the :mod:`random`
1405+
* The ``sample(population, k)`` function was added to the :mod:`random`
14061406
module. *population* is a sequence or :class:`xrange` object containing the
14071407
elements of a population, and :func:`sample` chooses *k* elements from the
14081408
population without replacing chosen elements. *k* can be any value up to
@@ -1448,15 +1448,15 @@ complete list of changes, or look through the CVS logs for all the details.
14481448
encryption is not believed to be secure. If you need encryption, use one of the
14491449
several AES Python modules that are available separately.
14501450

1451-
* The :mod:`shutil` module gained a :func:`move(src, dest)` function that
1451+
* The :mod:`shutil` module gained a ``move(src, dest)`` function that
14521452
recursively moves a file or directory to a new location.
14531453

14541454
* Support for more advanced POSIX signal handling was added to the :mod:`signal`
14551455
but then removed again as it proved impossible to make it work reliably across
14561456
platforms.
14571457

14581458
* The :mod:`socket` module now supports timeouts. You can call the
1459-
:meth:`settimeout(t)` method on a socket object to set a timeout of *t* seconds.
1459+
``settimeout(t)`` method on a socket object to set a timeout of *t* seconds.
14601460
Subsequent socket operations that take longer than *t* seconds to complete will
14611461
abort and raise a :exc:`socket.timeout` exception.
14621462

@@ -1477,9 +1477,9 @@ complete list of changes, or look through the CVS logs for all the details.
14771477
:program:`tar`\ -format archive files. (Contributed by Lars Gustäbel.)
14781478

14791479
* The new :mod:`textwrap` module contains functions for wrapping strings
1480-
containing paragraphs of text. The :func:`wrap(text, width)` function takes a
1480+
containing paragraphs of text. The ``wrap(text, width)`` function takes a
14811481
string and returns a list containing the text split into lines of no more than
1482-
the chosen width. The :func:`fill(text, width)` function returns a single
1482+
the chosen width. The ``fill(text, width)`` function returns a single
14831483
string, reformatted to fit into lines no longer than the chosen width. (As you
14841484
can guess, :func:`fill` is built on top of :func:`wrap`. For example::
14851485

@@ -1900,7 +1900,7 @@ Changes to Python's build process and to the C API include:
19001900
short int`, ``I`` for :c:type:`unsigned int`, and ``K`` for :c:type:`unsigned
19011901
long long`.
19021902

1903-
* A new function, :c:func:`PyObject_DelItemString(mapping, char \*key)` was added
1903+
* A new function, ``PyObject_DelItemString(mapping, char *key)`` was added
19041904
as shorthand for ``PyObject_DelItem(mapping, PyString_New(key))``.
19051905

19061906
* File objects now manage their internal string buffer differently, increasing

0 commit comments

Comments
 (0)