No parens anymore in :func: and :meth:.

This commit is contained in:
Georg Brandl 2007-08-13 21:04:50 +00:00
parent ba4557f58f
commit 3db541c50d
14 changed files with 74 additions and 74 deletions

View File

@ -249,16 +249,16 @@ upper left corner of a box (handy for drawing borders).
Windows remember where the cursor was left after the last operation, so if you
leave out the *y,x* coordinates, the string or character will be displayed
wherever the last operation left off. You can also move the cursor with the
:func:`move(y,x)` method. Because some terminals always display a flashing
cursor, you may want to ensure that the cursor is positioned in some location
where it won't be distracting; it can be confusing to have the cursor blinking
at some apparently random location.
``move(y,x)`` method. Because some terminals always display a flashing cursor,
you may want to ensure that the cursor is positioned in some location where it
won't be distracting; it can be confusing to have the cursor blinking at some
apparently random location.
If your application doesn't need a blinking cursor at all, you can call
:func:`curs_set(0)` to make it invisible. Equivalently, and for compatibility
with older curses versions, there's a :func:`leaveok(bool)` function. When
*bool* is true, the curses library will attempt to suppress the flashing cursor,
and you won't need to worry about leaving it in odd locations.
``curs_set(0)`` to make it invisible. Equivalently, and for compatibility with
older curses versions, there's a ``leaveok(bool)`` function. When *bool* is
true, the curses library will attempt to suppress the flashing cursor, and you
won't need to worry about leaving it in odd locations.
Attributes and Color
@ -328,9 +328,9 @@ They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and
7:white. The curses module defines named constants for each of these colors:
:const:`curses.COLOR_BLACK`, :const:`curses.COLOR_RED`, and so forth.
The :func:`init_pair(n, f, b)` function changes the definition of color pair
*n*, to foreground color f and background color b. Color pair 0 is hard-wired
to white on black, and cannot be changed.
The ``init_pair(n, f, b)`` function changes the definition of color pair *n*, to
foreground color f and background color b. Color pair 0 is hard-wired to white
on black, and cannot be changed.
Let's put all this together. To change color 1 to red text on a white
background, you would call::
@ -364,8 +364,8 @@ The most common way to get input to a window is to use its :meth:`getch` method.
to which the cursor should be moved before pausing.
It's possible to change this behavior with the method :meth:`nodelay`. After
:meth:`nodelay(1)`, :meth:`getch` for the window becomes non-blocking and
returns ``curses.ERR`` (a value of -1) when no input is ready. There's also a
``nodelay(1)``, :meth:`getch` for the window becomes non-blocking and returns
``curses.ERR`` (a value of -1) when no input is ready. There's also a
:func:`halfdelay` function, which can be used to (in effect) set a timer on each
:meth:`getch`; if no input becomes available within the number of milliseconds
specified as the argument to :func:`halfdelay`, curses raises an exception.

View File

@ -57,7 +57,7 @@ Here are the methods of the :class:`Message` class:
.. method:: Message.__str__()
Equivalent to :meth:`as_string(unixfrom=True)`.
Equivalent to ``as_string(unixfrom=True)``.
.. method:: Message.is_multipart()

View File

@ -371,7 +371,7 @@ Logger Objects
Loggers have the following attributes and methods. Note that Loggers are never
instantiated directly, but always through the module-level function
:func:`logging.getLogger(name)`.
``logging.getLogger(name)``.
.. attribute:: Logger.propagate
@ -405,7 +405,7 @@ instantiated directly, but always through the module-level function
Indicates if a message of severity *lvl* would be processed by this logger.
This method checks first the module-level level set by
:func:`logging.disable(lvl)` and then the logger's effective level as determined
``logging.disable(lvl)`` and then the logger's effective level as determined
by :meth:`getEffectiveLevel`.
@ -1620,14 +1620,14 @@ made, and any exception information to be logged.
Returns an instance of :class:`LogRecord` initialized with interesting
information. The *name* is the logger name; *lvl* is the numeric level;
*pathname* is the absolute pathname of the source file in which the logging call
was made; *lineno* is the line number in that file where the logging call is
found; *msg* is the user-supplied message (a format string); *args* is the tuple
which, together with *msg*, makes up the user message; and *exc_info* is the
exception tuple obtained by calling :func:`sys.exc_info()`\ (or :const:`None`,
if no exception information is available). The *func* is the name of the
function from which the logging call was made. If not specified, it defaults to
``None``.
*pathname* is the absolute pathname of the source file in which the logging
call was made; *lineno* is the line number in that file where the logging
call is found; *msg* is the user-supplied message (a format string); *args*
is the tuple which, together with *msg*, makes up the user message; and
*exc_info* is the exception tuple obtained by calling :func:`sys.exc_info`
(or :const:`None`, if no exception information is available). The *func* is
the name of the function from which the logging call was made. If not
specified, it defaults to ``None``.
.. versionchanged:: 2.5
*func* was added.

View File

@ -121,8 +121,8 @@ XMLParser Objects
.. method:: xmlparser.ParseFile(file)
Parse XML data reading from the object *file*. *file* only needs to provide the
:meth:`read(nbytes)` method, returning the empty string when there's no more
Parse XML data reading from the object *file*. *file* only needs to provide
the ``read(nbytes)`` method, returning the empty string when there's no more
data.

View File

@ -131,7 +131,7 @@ A single exception is defined as well:
This method is called to process a character reference of the form ``&#ref;``.
The base implementation uses :meth:`convert_charref` to convert the reference to
a string. If that method returns a string, it is passed to :meth:`handle_data`,
otherwise :meth:`unknown_charref(ref)` is called to handle the error.
otherwise ``unknown_charref(ref)`` is called to handle the error.
.. versionchanged:: 2.5
Use :meth:`convert_charref` instead of hard-coding the conversion.

View File

@ -160,13 +160,13 @@ characters up to U+01FF, which is represented by ``\777``.
Unicode strings, just like regular strings, are an immutable sequence type.
They can be indexed and sliced, but not modified in place. Unicode strings have
an :meth:`encode( [encoding] )` method that returns an 8-bit string in the
desired encoding. Encodings are named by strings, such as ``'ascii'``,
``'utf-8'``, ``'iso-8859-1'``, or whatever. A codec API is defined for
implementing and registering new encodings that are then available throughout a
Python program. If an encoding isn't specified, the default encoding is usually
7-bit ASCII, though it can be changed for your Python installation by calling
the :func:`sys.setdefaultencoding(encoding)` function in a customised version of
an ``encode( [encoding] )`` method that returns an 8-bit string in the desired
encoding. Encodings are named by strings, such as ``'ascii'``, ``'utf-8'``,
``'iso-8859-1'``, or whatever. A codec API is defined for implementing and
registering new encodings that are then available throughout a Python program.
If an encoding isn't specified, the default encoding is usually 7-bit ASCII,
though it can be changed for your Python installation by calling the
:func:`sys.setdefaultencoding(encoding)` function in a customised version of
:file:`site.py`.
Combining 8-bit and Unicode strings always coerces to Unicode, using the default

View File

@ -126,7 +126,7 @@ complete list of changes, or look through the CVS logs for all the details.
* The :mod:`gopherlib` module has been removed.
* New function in the :mod:`heapq` module: :func:`merge(iter1, iter2, ...)`
* New function in the :mod:`heapq` module: ``merge(iter1, iter2, ...)``
takes any number of iterables that return data *in sorted order*, and returns
a new iterator that returns the contents of all the iterators, also in sorted
order. For example::
@ -136,8 +136,8 @@ complete list of changes, or look through the CVS logs for all the details.
(Contributed by Raymond Hettinger.)
* New function in the :mod:`itertools` module: :func:`izip_longest(iter1, iter2,
...[, fillvalue])` makes tuples from each of the elements; if some of the
* New function in the :mod:`itertools` module: ``izip_longest(iter1, iter2,
...[, fillvalue])`` makes tuples from each of the elements; if some of the
iterables are shorter than others, the missing values are set to *fillvalue*.
For example::

View File

@ -249,16 +249,16 @@ upper left corner of a box (handy for drawing borders).
Windows remember where the cursor was left after the last operation, so if you
leave out the *y,x* coordinates, the string or character will be displayed
wherever the last operation left off. You can also move the cursor with the
:func:`move(y,x)` method. Because some terminals always display a flashing
cursor, you may want to ensure that the cursor is positioned in some location
where it won't be distracting; it can be confusing to have the cursor blinking
at some apparently random location.
``move(y,x)`` method. Because some terminals always display a flashing cursor,
you may want to ensure that the cursor is positioned in some location where it
won't be distracting; it can be confusing to have the cursor blinking at some
apparently random location.
If your application doesn't need a blinking cursor at all, you can call
:func:`curs_set(0)` to make it invisible. Equivalently, and for compatibility
with older curses versions, there's a :func:`leaveok(bool)` function. When
*bool* is true, the curses library will attempt to suppress the flashing cursor,
and you won't need to worry about leaving it in odd locations.
``curs_set(0)`` to make it invisible. Equivalently, and for compatibility with
older curses versions, there's a ``leaveok(bool)`` function. When *bool* is
true, the curses library will attempt to suppress the flashing cursor, and you
won't need to worry about leaving it in odd locations.
Attributes and Color
@ -328,9 +328,9 @@ They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and
7:white. The curses module defines named constants for each of these colors:
:const:`curses.COLOR_BLACK`, :const:`curses.COLOR_RED`, and so forth.
The :func:`init_pair(n, f, b)` function changes the definition of color pair
*n*, to foreground color f and background color b. Color pair 0 is hard-wired
to white on black, and cannot be changed.
The ``init_pair(n, f, b)`` function changes the definition of color pair *n*, to
foreground color f and background color b. Color pair 0 is hard-wired to white
on black, and cannot be changed.
Let's put all this together. To change color 1 to red text on a white
background, you would call::
@ -364,8 +364,8 @@ The most common way to get input to a window is to use its :meth:`getch` method.
to which the cursor should be moved before pausing.
It's possible to change this behavior with the method :meth:`nodelay`. After
:meth:`nodelay(1)`, :meth:`getch` for the window becomes non-blocking and
returns ``curses.ERR`` (a value of -1) when no input is ready. There's also a
``nodelay(1)``, :meth:`getch` for the window becomes non-blocking and returns
``curses.ERR`` (a value of -1) when no input is ready. There's also a
:func:`halfdelay` function, which can be used to (in effect) set a timer on each
:meth:`getch`; if no input becomes available within the number of milliseconds
specified as the argument to :func:`halfdelay`, curses raises an exception.

View File

@ -57,7 +57,7 @@ Here are the methods of the :class:`Message` class:
.. method:: Message.__str__()
Equivalent to :meth:`as_string(unixfrom=True)`.
Equivalent to ``as_string(unixfrom=True)``.
.. method:: Message.is_multipart()

View File

@ -371,7 +371,7 @@ Logger Objects
Loggers have the following attributes and methods. Note that Loggers are never
instantiated directly, but always through the module-level function
:func:`logging.getLogger(name)`.
``logging.getLogger(name)``.
.. attribute:: Logger.propagate
@ -405,7 +405,7 @@ instantiated directly, but always through the module-level function
Indicates if a message of severity *lvl* would be processed by this logger.
This method checks first the module-level level set by
:func:`logging.disable(lvl)` and then the logger's effective level as determined
``logging.disable(lvl)`` and then the logger's effective level as determined
by :meth:`getEffectiveLevel`.
@ -1620,14 +1620,14 @@ made, and any exception information to be logged.
Returns an instance of :class:`LogRecord` initialized with interesting
information. The *name* is the logger name; *lvl* is the numeric level;
*pathname* is the absolute pathname of the source file in which the logging call
was made; *lineno* is the line number in that file where the logging call is
found; *msg* is the user-supplied message (a format string); *args* is the tuple
which, together with *msg*, makes up the user message; and *exc_info* is the
exception tuple obtained by calling :func:`sys.exc_info()`\ (or :const:`None`,
if no exception information is available). The *func* is the name of the
function from which the logging call was made. If not specified, it defaults to
``None``.
*pathname* is the absolute pathname of the source file in which the logging
call was made; *lineno* is the line number in that file where the logging
call is found; *msg* is the user-supplied message (a format string); *args*
is the tuple which, together with *msg*, makes up the user message; and
*exc_info* is the exception tuple obtained by calling :func:`sys.exc_info`
(or :const:`None`, if no exception information is available). The *func* is
the name of the function from which the logging call was made. If not
specified, it defaults to ``None``.
.. versionchanged:: 2.5
*func* was added.

View File

@ -121,8 +121,8 @@ XMLParser Objects
.. method:: xmlparser.ParseFile(file)
Parse XML data reading from the object *file*. *file* only needs to provide the
:meth:`read(nbytes)` method, returning the empty string when there's no more
Parse XML data reading from the object *file*. *file* only needs to provide
the ``read(nbytes)`` method, returning the empty string when there's no more
data.

View File

@ -131,7 +131,7 @@ A single exception is defined as well:
This method is called to process a character reference of the form ``&#ref;``.
The base implementation uses :meth:`convert_charref` to convert the reference to
a string. If that method returns a string, it is passed to :meth:`handle_data`,
otherwise :meth:`unknown_charref(ref)` is called to handle the error.
otherwise ``unknown_charref(ref)`` is called to handle the error.
.. versionchanged:: 2.5
Use :meth:`convert_charref` instead of hard-coding the conversion.

View File

@ -160,13 +160,13 @@ characters up to U+01FF, which is represented by ``\777``.
Unicode strings, just like regular strings, are an immutable sequence type.
They can be indexed and sliced, but not modified in place. Unicode strings have
an :meth:`encode( [encoding] )` method that returns an 8-bit string in the
desired encoding. Encodings are named by strings, such as ``'ascii'``,
``'utf-8'``, ``'iso-8859-1'``, or whatever. A codec API is defined for
implementing and registering new encodings that are then available throughout a
Python program. If an encoding isn't specified, the default encoding is usually
7-bit ASCII, though it can be changed for your Python installation by calling
the :func:`sys.setdefaultencoding(encoding)` function in a customised version of
an ``encode( [encoding] )`` method that returns an 8-bit string in the desired
encoding. Encodings are named by strings, such as ``'ascii'``, ``'utf-8'``,
``'iso-8859-1'``, or whatever. A codec API is defined for implementing and
registering new encodings that are then available throughout a Python program.
If an encoding isn't specified, the default encoding is usually 7-bit ASCII,
though it can be changed for your Python installation by calling the
:func:`sys.setdefaultencoding(encoding)` function in a customised version of
:file:`site.py`.
Combining 8-bit and Unicode strings always coerces to Unicode, using the default

View File

@ -126,7 +126,7 @@ complete list of changes, or look through the CVS logs for all the details.
* The :mod:`gopherlib` module has been removed.
* New function in the :mod:`heapq` module: :func:`merge(iter1, iter2, ...)`
* New function in the :mod:`heapq` module: ``merge(iter1, iter2, ...)``
takes any number of iterables that return data *in sorted order*, and returns
a new iterator that returns the contents of all the iterators, also in sorted
order. For example::
@ -136,8 +136,8 @@ complete list of changes, or look through the CVS logs for all the details.
(Contributed by Raymond Hettinger.)
* New function in the :mod:`itertools` module: :func:`izip_longest(iter1, iter2,
...[, fillvalue])` makes tuples from each of the elements; if some of the
* New function in the :mod:`itertools` module: ``izip_longest(iter1, iter2,
...[, fillvalue])`` makes tuples from each of the elements; if some of the
iterables are shorter than others, the missing values are set to *fillvalue*.
For example::