Skip to content

Commit 12481e2

Browse files
author
georg.brandl
committed
Fix uses of the default role.
git-svn-id: http://svn.python.org/projects/python/trunk@68219 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 27da4f9 commit 12481e2

11 files changed

+77
-79
lines changed

Doc/c-api/file.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ change in future releases of Python.
6363
Return the file object associated with *p* as a :ctype:`FILE\*`.
6464

6565
If the caller will ever use the returned :ctype:`FILE\*` object while
66-
the GIL is released it must also call the `PyFile_IncUseCount` and
67-
`PyFile_DecUseCount` functions described below as appropriate.
66+
the GIL is released it must also call the :cfunc:`PyFile_IncUseCount` and
67+
:cfunc:`PyFile_DecUseCount` functions described below as appropriate.
6868

6969

7070
.. cfunction:: void PyFile_IncUseCount(PyFileObject \*p)
7171

7272
Increments the PyFileObject's internal use count to indicate
7373
that the underlying :ctype:`FILE\*` is being used.
7474
This prevents Python from calling f_close() on it from another thread.
75-
Callers of this must call `PyFile_DecUseCount` when they are
75+
Callers of this must call :cfunc:`PyFile_DecUseCount` when they are
7676
finished with the :ctype:`FILE\*`. Otherwise the file object will
7777
never be closed by Python.
7878

7979
The GIL must be held while calling this function.
8080

81-
The suggested use is to call this after `PyFile_AsFile` just before
81+
The suggested use is to call this after :cfunc:`PyFile_AsFile` just before
8282
you release the GIL.
8383

8484
.. versionadded:: 2.6
@@ -88,7 +88,7 @@ change in future releases of Python.
8888

8989
Decrements the PyFileObject's internal unlocked_count member to
9090
indicate that the caller is done with its own use of the :ctype:`FILE\*`.
91-
This may only be called to undo a prior call to `PyFile_IncUseCount`.
91+
This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`.
9292

9393
The GIL must be held while calling this function.
9494

Doc/distutils/uploading.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must
3535
be available for execution on the system :envvar:`PATH`. You can also specify
3636
which key to use for signing using the :option:`--identity=*name*` option.
3737

38-
Other :command:`upload` options include :option:`--repository=*url*`
39-
or :option:`--repository=*section*` where `url` is the url of the server
40-
and `section` the name of the section in :file:`$HOME/.pypirc`, and
38+
Other :command:`upload` options include :option:`--repository=<url>` or
39+
:option:`--repository=<section>` where *url* is the url of the server and
40+
*section* the name of the section in :file:`$HOME/.pypirc`, and
4141
:option:`--show-response` (which displays the full response text from the PyPI
4242
server for help in debugging upload problems).
4343

Doc/documenting/markup.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ units as well as normal text:
599599
Example::
600600

601601
.. versionadded:: 2.5
602-
The `spam` parameter.
602+
The *spam* parameter.
603603

604604
Note that there must be no blank line between the directive head and the
605605
explanation; this is to make these blocks visually continuous in the markup.
@@ -760,7 +760,7 @@ the definition of the symbol. There is this directive:
760760
Blank lines are not allowed within ``productionlist`` directive arguments.
761761

762762
The definition can contain token names which are marked as interpreted text
763-
(e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references
763+
(e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references
764764
to the productions of these tokens.
765765

766766
Note that no further reST parsing is done in the production, so that you

Doc/library/ast.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ and classes for traversing abstract syntax trees:
191191

192192
A node visitor base class that walks the abstract syntax tree and calls a
193193
visitor function for every node found. This function may return a value
194-
which is forwarded by the `visit` method.
194+
which is forwarded by the :meth:`visit` method.
195195

196196
This class is meant to be subclassed, with the subclass adding visitor
197197
methods.
@@ -220,11 +220,11 @@ and classes for traversing abstract syntax trees:
220220
A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
221221
allows modification of nodes.
222222

223-
The `NodeTransformer` will walk the AST and use the return value of the
224-
visitor methods to replace or remove the old node. If the return value of
225-
the visitor method is ``None``, the node will be removed from its location,
226-
otherwise it is replaced with the return value. The return value may be the
227-
original node in which case no replacement takes place.
223+
The :class:`NodeTransformer` will walk the AST and use the return value of
224+
the visitor methods to replace or remove the old node. If the return value
225+
of the visitor method is ``None``, the node will be removed from its
226+
location, otherwise it is replaced with the return value. The return value
227+
may be the original node in which case no replacement takes place.
228228

229229
Here is an example transformer that rewrites all occurrences of name lookups
230230
(``foo``) to ``data['foo']``::

Doc/library/configparser.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
.. note::
1313

14-
The :mod:`ConfigParser` module has been renamed to `configparser` in Python
15-
3.0. The :term:`2to3` tool will automatically adapt imports when converting
16-
your sources to 3.0.
14+
The :mod:`ConfigParser` module has been renamed to :mod:`configparser` in
15+
Python 3.0. The :term:`2to3` tool will automatically adapt imports when
16+
converting your sources to 3.0.
1717

1818
.. index::
1919
pair: .ini; file

Doc/library/ctypes.rst

+37-39
Original file line numberDiff line numberDiff line change
@@ -1378,24 +1378,22 @@ it.
13781378
The *mode* parameter can be used to specify how the library is loaded. For
13791379
details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored.
13801380

1381-
The *use_errno* parameter, when set to True, enables a ctypes
1382-
mechanism that allows to access the system `errno` error number in a
1383-
safe way. `ctypes` maintains a thread-local copy of the systems
1384-
`errno` variable; if you call foreign functions created with
1385-
`use_errno=True` then the `errno` value before the function call is
1386-
swapped with the ctypes private copy, the same happens immediately
1387-
after the function call.
1388-
1389-
The function `ctypes.get_errno()` returns the value of the ctypes
1390-
private copy, and the function `ctypes.set_errno(value)` changes the
1391-
ctypes private copy to `value` and returns the former value.
1392-
1393-
The *use_last_error* parameter, when set to True, enables the same
1394-
mechanism for the Windows error code which is managed by the
1395-
:func:`GetLastError` and :func:`SetLastError` Windows API functions;
1396-
`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used
1397-
to request and change the ctypes private copy of the windows error
1398-
code.
1381+
The *use_errno* parameter, when set to True, enables a ctypes mechanism that
1382+
allows to access the system :data:`errno` error number in a safe way.
1383+
:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno`
1384+
variable; if you call foreign functions created with ``use_errno=True`` then the
1385+
:data:`errno` value before the function call is swapped with the ctypes private
1386+
copy, the same happens immediately after the function call.
1387+
1388+
The function :func:`ctypes.get_errno` returns the value of the ctypes private
1389+
copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy
1390+
to a new value and returns the former value.
1391+
1392+
The *use_last_error* parameter, when set to True, enables the same mechanism for
1393+
the Windows error code which is managed by the :func:`GetLastError` and
1394+
:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and
1395+
:func:`ctypes.set_last_error` are used to request and change the ctypes private
1396+
copy of the windows error code.
13991397

14001398
.. versionadded:: 2.6
14011399
The ``use_last_error`` and ``use_errno`` optional parameters
@@ -1602,22 +1600,23 @@ type and the argument types of the function.
16021600
.. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
16031601

16041602
The returned function prototype creates functions that use the standard C
1605-
calling convention. The function will release the GIL during the call.
1606-
If `use_errno` is set to True, the ctypes private copy of the system `errno`
1607-
variable is exchanged with the real `errno` value bafore and after the call;
1608-
`use_last_error` does the same for the Windows error code.
1603+
calling convention. The function will release the GIL during the call. If
1604+
*use_errno* is set to True, the ctypes private copy of the system
1605+
:data:`errno` variable is exchanged with the real :data:`errno` value bafore
1606+
and after the call; *use_last_error* does the same for the Windows error
1607+
code.
16091608

16101609
.. versionchanged:: 2.6
1611-
The optional `use_errno` and `use_last_error` parameters were
1612-
added.
1610+
The optional *use_errno* and *use_last_error* parameters were added.
16131611

16141612

16151613
.. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
16161614

16171615
Windows only: The returned function prototype creates functions that use the
1618-
``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE`
1619-
is the same as :func:`CFUNCTYPE`. The function will release the GIL during the
1620-
call. `use_errno` and `use_last_error` have the same meaning as above.
1616+
``stdcall`` calling convention, except on Windows CE where
1617+
:func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will
1618+
release the GIL during the call. *use_errno* and *use_last_error* have the
1619+
same meaning as above.
16211620

16221621

16231622
.. function:: PYFUNCTYPE(restype, *argtypes)
@@ -1864,10 +1863,10 @@ Utility functions
18641863
.. function:: find_library(name)
18651864
:module: ctypes.util
18661865

1867-
Try to find a library and return a pathname. `name` is the library name without
1868-
any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this
1869-
is the form used for the posix linker option :option:`-l`). If no library can
1870-
be found, returns ``None``.
1866+
Try to find a library and return a pathname. *name* is the library name
1867+
without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version
1868+
number (this is the form used for the posix linker option :option:`-l`). If
1869+
no library can be found, returns ``None``.
18711870

18721871
The exact functionality is system dependent.
18731872

@@ -1905,14 +1904,14 @@ Utility functions
19051904
.. function:: get_errno()
19061905

19071906
Returns the current value of the ctypes-private copy of the system
1908-
`errno` variable in the calling thread.
1907+
:data:`errno` variable in the calling thread.
19091908

19101909
.. versionadded:: 2.6
19111910

19121911
.. function:: get_last_error()
19131912

19141913
Windows only: returns the current value of the ctypes-private copy of the system
1915-
`LastError` variable in the calling thread.
1914+
:data:`LastError` variable in the calling thread.
19161915

19171916
.. versionadded:: 2.6
19181917

@@ -1969,17 +1968,16 @@ Utility functions
19691968

19701969
.. function:: set_errno(value)
19711970

1972-
Set the current value of the ctypes-private copy of the system
1973-
`errno` variable in the calling thread to `value` and return the
1974-
previous value.
1971+
Set the current value of the ctypes-private copy of the system :data:`errno`
1972+
variable in the calling thread to *value* and return the previous value.
19751973

19761974
.. versionadded:: 2.6
19771975

19781976
.. function:: set_last_error(value)
19791977

1980-
Windows only: set the current value of the ctypes-private copy of
1981-
the system `LastError` variable in the calling thread to `value`
1982-
and return the previous value.
1978+
Windows only: set the current value of the ctypes-private copy of the system
1979+
:data:`LastError` variable in the calling thread to *value* and return the
1980+
previous value.
19831981

19841982
.. versionadded:: 2.6
19851983

Doc/library/decimal.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ In addition to the three supplied contexts, new contexts can be created with the
12111211

12121212
.. method:: logical_and(x, y)
12131213

1214-
Applies the logical operation `and` between each operand's digits.
1214+
Applies the logical operation *and* between each operand's digits.
12151215

12161216

12171217
.. method:: logical_invert(x)
@@ -1221,12 +1221,12 @@ In addition to the three supplied contexts, new contexts can be created with the
12211221

12221222
.. method:: logical_or(x, y)
12231223

1224-
Applies the logical operation `or` between each operand's digits.
1224+
Applies the logical operation *or* between each operand's digits.
12251225

12261226

12271227
.. method:: logical_xor(x, y)
12281228

1229-
Applies the logical operation `xor` between each operand's digits.
1229+
Applies the logical operation *xor* between each operand's digits.
12301230

12311231

12321232
.. method:: max(x, y)
@@ -1337,8 +1337,8 @@ In addition to the three supplied contexts, new contexts can be created with the
13371337

13381338
.. method:: remainder_near(x, y)
13391339

1340-
Returns `x - y * n`, where *n* is the integer nearest the exact value
1341-
of `x / y` (if the result is `0` then its sign will be the sign of *x*).
1340+
Returns ``x - y * n``, where *n* is the integer nearest the exact value
1341+
of ``x / y`` (if the result is 0 then its sign will be the sign of *x*).
13421342

13431343

13441344
.. method:: rotate(x, y)

Doc/library/fractions.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ another rational number, or from a string.
101101

102102
.. function:: gcd(a, b)
103103

104-
Return the greatest common divisor of the integers `a` and `b`. If
105-
either `a` or `b` is nonzero, then the absolute value of `gcd(a,
106-
b)` is the largest integer that divides both `a` and `b`. `gcd(a,b)`
107-
has the same sign as `b` if `b` is nonzero; otherwise it takes the sign
108-
of `a`. `gcd(0, 0)` returns `0`.
104+
Return the greatest common divisor of the integers *a* and *b*. If either
105+
*a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the
106+
largest integer that divides both *a* and *b*. ``gcd(a,b)`` has the same
107+
sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0,
108+
0)`` returns ``0``.
109109

110110

111111
.. seealso::

Doc/library/repr.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of
125125
the handling of types already supported. This example shows how special support
126126
for file objects could be added::
127127

128-
import repr
128+
import repr as reprlib
129129
import sys
130130

131-
class MyRepr(repr.Repr):
131+
class MyRepr(reprlib.Repr):
132132
def repr_file(self, obj, level):
133133
if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
134134
return obj.name
135135
else:
136-
return `obj`
136+
return repr(obj)
137137

138138
aRepr = MyRepr()
139139
print aRepr.repr(sys.stdin) # prints '<stdin>'

Doc/library/socketserver.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
.. note::
99

10-
The :mod:`SocketServer` module has been renamed to `socketserver` in Python
11-
3.0. The :term:`2to3` tool will automatically adapt imports when converting
12-
your sources to 3.0.
10+
The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in
11+
Python 3.0. The :term:`2to3` tool will automatically adapt imports when
12+
converting your sources to 3.0.
1313

1414

1515
The :mod:`SocketServer` module simplifies the task of writing network servers.

Doc/library/tempfile.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ The module defines the following user-callable functions:
164164

165165
.. warning::
166166

167-
Use of this function may introduce a security hole in your program.
168-
By the time you get around to doing anything with the file name it
169-
returns, someone else may have beaten you to the punch.
170-
:func:`mktemp` usage can be replaced easily with
171-
:func:`NamedTemporaryFile`, passing it the `delete=False` parameter::
167+
Use of this function may introduce a security hole in your program. By
168+
the time you get around to doing anything with the file name it returns,
169+
someone else may have beaten you to the punch. :func:`mktemp` usage can
170+
be replaced easily with :func:`NamedTemporaryFile`, passing it the
171+
``delete=False`` parameter::
172172

173173
>>> f = NamedTemporaryFile(delete=False)
174174
>>> f

0 commit comments

Comments
 (0)