Skip to content

Commit 1234488

Browse files
committed
Issue python#15527: remove double parens by changing markup.
Patch by Serhiy Storchaka.
1 parent c7496ee commit 1234488

File tree

8 files changed

+94
-94
lines changed

8 files changed

+94
-94
lines changed

Doc/library/os.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ process and user.
329329

330330
.. function:: setpgrp()
331331

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

335335
Availability: Unix.

Doc/library/platform.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Cross Platform
3333
returned as strings.
3434

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

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

Doc/whatsnew/2.0.rst

+5-5
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

+4-4
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

+11-11
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

+20-20
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ This produces the following output::
506506
ZeroDivisionError: integer division or modulo by zero
507507

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

512512
log = logging.getLogger('server')
513513
...
@@ -726,10 +726,10 @@ module:
726726
objects to it. Additional built-in and frozen modules can be imported by an
727727
object added to this list.
728728

729-
Importer objects must have a single method, :meth:`find_module(fullname,
730-
path=None)`. *fullname* will be a module or package name, e.g. ``string`` or
729+
Importer objects must have a single method, ``find_module(fullname,
730+
path=None)``. *fullname* will be a module or package name, e.g. ``string`` or
731731
``distutils.core``. :meth:`find_module` must return a loader object that has a
732-
single method, :meth:`load_module(fullname)`, that creates and returns the
732+
single method, ``load_module(fullname)``, that creates and returns the
733733
corresponding module object.
734734

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

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

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

1003-
* Dictionaries have a new method, :meth:`pop(key[, *default*])`, that returns
1003+
* Dictionaries have a new method, ``pop(key[, *default*])``, that returns
10041004
the value corresponding to *key* and removes that key/value pair from the
10051005
dictionary. If the requested key isn't present in the dictionary, *default* is
10061006
returned if it's specified and :exc:`KeyError` raised if it isn't. ::
@@ -1022,7 +1022,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
10221022
{}
10231023
>>>
10241024

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

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

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

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

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

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

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

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

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

14591459
* Support for more advanced POSIX signal handling was added to the :mod:`signal`
14601460
but then removed again as it proved impossible to make it work reliably across
14611461
platforms.
14621462

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

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

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

@@ -1909,7 +1909,7 @@ Changes to Python's build process and to the C API include:
19091909
short int`, ``I`` for :c:type:`unsigned int`, and ``K`` for :c:type:`unsigned
19101910
long long`.
19111911

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

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

0 commit comments

Comments
 (0)