Issue #19795: Improved markup of True/False constants.

This commit is contained in:
Serhiy Storchaka 2013-11-29 12:19:53 +02:00
commit 0e90e99188
44 changed files with 93 additions and 87 deletions

View File

@ -422,7 +422,7 @@ RGB value. This lets you change color 1, which is usually red, to purple or
blue or any other color you like. Unfortunately, the Linux console doesn't blue or any other color you like. Unfortunately, the Linux console doesn't
support this, so I'm unable to try it out, and can't provide any examples. You support this, so I'm unable to try it out, and can't provide any examples. You
can check if your terminal can do this by calling can check if your terminal can do this by calling
:func:`~curses.can_change_color`, which returns True if the capability is :func:`~curses.can_change_color`, which returns ``True`` if the capability is
there. If you're lucky enough to have such a talented terminal, consult your there. If you're lucky enough to have such a talented terminal, consult your
system's man pages for more information. system's man pages for more information.

View File

@ -689,8 +689,8 @@ constructed list's :meth:`~list.sort` method. ::
The :func:`any(iter) <any>` and :func:`all(iter) <all>` built-ins look at the The :func:`any(iter) <any>` and :func:`all(iter) <all>` built-ins look at the
truth values of an iterable's contents. :func:`any` returns True if any element truth values of an iterable's contents. :func:`any` returns ``True`` if any element
in the iterable is a true value, and :func:`all` returns True if all of the in the iterable is a true value, and :func:`all` returns ``True`` if all of the
elements are true values: elements are true values:
>>> any([0,1,0]) >>> any([0,1,0])

View File

@ -244,6 +244,6 @@ and classes for traversing abstract syntax trees:
Return a formatted dump of the tree in *node*. This is mainly useful for Return a formatted dump of the tree in *node*. This is mainly useful for
debugging purposes. The returned string will show the names and the values debugging purposes. The returned string will show the names and the values
for fields. This makes the code impossible to evaluate, so if evaluation is for fields. This makes the code impossible to evaluate, so if evaluation is
wanted *annotate_fields* must be set to False. Attributes such as line wanted *annotate_fields* must be set to ``False``. Attributes such as line
numbers and column offsets are not dumped by default. If this is wanted, numbers and column offsets are not dumped by default. If this is wanted,
*include_attributes* can be set to ``True``. *include_attributes* can be set to ``True``.

View File

@ -194,17 +194,17 @@ The :mod:`bdb` module also defines two classes:
.. method:: user_line(frame) .. method:: user_line(frame)
This method is called from :meth:`dispatch_line` when either This method is called from :meth:`dispatch_line` when either
:meth:`stop_here` or :meth:`break_here` yields True. :meth:`stop_here` or :meth:`break_here` yields ``True``.
.. method:: user_return(frame, return_value) .. method:: user_return(frame, return_value)
This method is called from :meth:`dispatch_return` when :meth:`stop_here` This method is called from :meth:`dispatch_return` when :meth:`stop_here`
yields True. yields ``True``.
.. method:: user_exception(frame, exc_info) .. method:: user_exception(frame, exc_info)
This method is called from :meth:`dispatch_exception` when This method is called from :meth:`dispatch_exception` when
:meth:`stop_here` yields True. :meth:`stop_here` yields ``True``.
.. method:: do_clear(arg) .. method:: do_clear(arg)
@ -245,7 +245,7 @@ The :mod:`bdb` module also defines two classes:
.. method:: set_quit() .. method:: set_quit()
Set the :attr:`quitting` attribute to True. This raises :exc:`BdbQuit` in Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` in
the next call to one of the :meth:`dispatch_\*` methods. the next call to one of the :meth:`dispatch_\*` methods.

View File

@ -169,7 +169,7 @@ Incremental (de)compression
.. attribute:: eof .. attribute:: eof
True if the end-of-stream marker has been reached. ``True`` if the end-of-stream marker has been reached.
.. versionadded:: 3.3 .. versionadded:: 3.3

View File

@ -2242,7 +2242,7 @@ These are the fundamental ctypes data types:
.. class:: c_bool .. class:: c_bool
Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` from Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` from
C99). Its value can be True or False, and the constructor accepts any object C99). Its value can be ``True`` or ``False``, and the constructor accepts any object
that has a truth value. that has a truth value.

View File

@ -359,7 +359,7 @@ The :class:`SequenceMatcher` class has this constructor:
The *autojunk* parameter. The *autojunk* parameter.
SequenceMatcher objects get three data attributes: *bjunk* is the SequenceMatcher objects get three data attributes: *bjunk* is the
set of elements of *b* for which *isjunk* is True; *bpopular* is the set of set of elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of
non-junk elements considered popular by the heuristic (if it is not non-junk elements considered popular by the heuristic (if it is not
disabled); *b2j* is a dict mapping the remaining elements of *b* to a list disabled); *b2j* is a dict mapping the remaining elements of *b* to a list
of positions where they occur. All three are reset whenever *b* is reset of positions where they occur. All three are reset whenever *b* is reset

View File

@ -274,7 +274,7 @@ details of bytecode instructions as :class:`Instruction` instances:
.. data:: is_jump_target .. data:: is_jump_target
True if other code jumps to here, otherwise False ``True`` if other code jumps to here, otherwise ``False``
.. versionadded:: 3.4 .. versionadded:: 3.4

View File

@ -131,7 +131,7 @@ Here are the methods of the :class:`Message` class:
Return ``True`` if the message's payload is a list of sub-\ Return ``True`` if the message's payload is a list of sub-\
:class:`Message` objects, otherwise return ``False``. When :class:`Message` objects, otherwise return ``False``. When
:meth:`is_multipart` returns False, the payload should be a string object. :meth:`is_multipart` returns ``False``, the payload should be a string object.
.. method:: set_unixfrom(unixfrom) .. method:: set_unixfrom(unixfrom)

View File

@ -48,7 +48,7 @@ are always available. They are listed here in alphabetical order.
.. function:: all(iterable) .. function:: all(iterable)
Return True if all elements of the *iterable* are true (or if the iterable Return ``True`` if all elements of the *iterable* are true (or if the iterable
is empty). Equivalent to:: is empty). Equivalent to::
def all(iterable): def all(iterable):
@ -60,8 +60,8 @@ are always available. They are listed here in alphabetical order.
.. function:: any(iterable) .. function:: any(iterable)
Return True if any element of the *iterable* is true. If the iterable Return ``True`` if any element of the *iterable* is true. If the iterable
is empty, return False. Equivalent to:: is empty, return ``False``. Equivalent to::
def any(iterable): def any(iterable):
for element in iterable: for element in iterable:
@ -905,7 +905,7 @@ are always available. They are listed here in alphabetical order.
the buffer will typically be 4096 or 8192 bytes long. the buffer will typically be 4096 or 8192 bytes long.
* "Interactive" text files (files for which :meth:`~io.IOBase.isatty` * "Interactive" text files (files for which :meth:`~io.IOBase.isatty`
returns True) use line buffering. Other text files use the policy returns ``True``) use line buffering. Other text files use the policy
described above for binary files. described above for binary files.
*encoding* is the name of the encoding used to decode or encode the file. *encoding* is the name of the encoding used to decode or encode the file.

View File

@ -148,8 +148,8 @@ The :mod:`gc` module provides the following functions:
.. function:: is_tracked(obj) .. function:: is_tracked(obj)
Returns True if the object is currently tracked by the garbage collector, Returns ``True`` if the object is currently tracked by the garbage collector,
False otherwise. As a general rule, instances of atomic types aren't ``False`` otherwise. As a general rule, instances of atomic types aren't
tracked and instances of non-atomic types (containers, user-defined tracked and instances of non-atomic types (containers, user-defined
objects...) are. However, some type-specific optimizations can be present objects...) are. However, some type-specific optimizations can be present
in order to suppress the garbage collector footprint of simple instances in order to suppress the garbage collector footprint of simple instances

View File

@ -573,7 +573,7 @@ statement.
.. attribute:: HTTPResponse.closed .. attribute:: HTTPResponse.closed
Is True if the stream is closed. Is ``True`` if the stream is closed.
Examples Examples
-------- --------

View File

@ -90,7 +90,7 @@ The following classes are provided:
Netscape and RFC 2965 cookies. By default, RFC 2109 cookies (ie. cookies Netscape and RFC 2965 cookies. By default, RFC 2109 cookies (ie. cookies
received in a :mailheader:`Set-Cookie` header with a version cookie-attribute of received in a :mailheader:`Set-Cookie` header with a version cookie-attribute of
1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling 1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling
is turned off or :attr:`rfc2109_as_netscape` is True, RFC 2109 cookies are is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are
'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by 'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by
setting the :attr:`version` attribute of the :class:`Cookie` instance to 0. setting the :attr:`version` attribute of the :class:`Cookie` instance to 0.
:class:`DefaultCookiePolicy` also provides some parameters to allow some :class:`DefaultCookiePolicy` also provides some parameters to allow some
@ -644,7 +644,7 @@ internal consistency, so you should know what you're doing if you do that.
.. attribute:: Cookie.secure .. attribute:: Cookie.secure
True if cookie should only be returned over a secure connection. ``True`` if cookie should only be returned over a secure connection.
.. attribute:: Cookie.expires .. attribute:: Cookie.expires
@ -655,7 +655,7 @@ internal consistency, so you should know what you're doing if you do that.
.. attribute:: Cookie.discard .. attribute:: Cookie.discard
True if this is a session cookie. ``True`` if this is a session cookie.
.. attribute:: Cookie.comment .. attribute:: Cookie.comment
@ -672,7 +672,7 @@ internal consistency, so you should know what you're doing if you do that.
.. attribute:: Cookie.rfc2109 .. attribute:: Cookie.rfc2109
True if this cookie was received as an RFC 2109 cookie (ie. the cookie ``True`` if this cookie was received as an RFC 2109 cookie (ie. the cookie
arrived in a :mailheader:`Set-Cookie` header, and the value of the Version arrived in a :mailheader:`Set-Cookie` header, and the value of the Version
cookie-attribute in that header was 1). This attribute is provided because cookie-attribute in that header was 1). This attribute is provided because
:mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in
@ -681,18 +681,18 @@ internal consistency, so you should know what you're doing if you do that.
.. attribute:: Cookie.port_specified .. attribute:: Cookie.port_specified
True if a port or set of ports was explicitly specified by the server (in the ``True`` if a port or set of ports was explicitly specified by the server (in the
:mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header). :mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header).
.. attribute:: Cookie.domain_specified .. attribute:: Cookie.domain_specified
True if a domain was explicitly specified by the server. ``True`` if a domain was explicitly specified by the server.
.. attribute:: Cookie.domain_initial_dot .. attribute:: Cookie.domain_initial_dot
True if the domain explicitly specified by the server began with a dot ``True`` if the domain explicitly specified by the server began with a dot
(``'.'``). (``'.'``).
Cookies may have additional non-standard cookie-attributes. These may be Cookies may have additional non-standard cookie-attributes. These may be
@ -719,7 +719,7 @@ The :class:`Cookie` class also defines the following method:
.. method:: Cookie.is_expired(now=None) .. method:: Cookie.is_expired(now=None)
True if cookie has passed the time at which the server requested it should ``True`` if cookie has passed the time at which the server requested it should
expire. If *now* is given (in seconds since the epoch), return whether the expire. If *now* is given (in seconds since the epoch), return whether the
cookie has expired at the specified time. cookie has expired at the specified time.

View File

@ -200,8 +200,8 @@ file paths.
The ``cpython-32`` string comes from the current magic tag (see The ``cpython-32`` string comes from the current magic tag (see
:func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then :func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then
:exc:`NotImplementedError` will be raised). The returned path will end in :exc:`NotImplementedError` will be raised). The returned path will end in
``.pyc`` when ``__debug__`` is True or ``.pyo`` for an optimized Python ``.pyc`` when ``__debug__`` is ``True`` or ``.pyo`` for an optimized Python
(i.e. ``__debug__`` is False). By passing in True or False for (i.e. ``__debug__`` is ``False``). By passing in ``True`` or ``False`` for
*debug_override* you can override the system's value for ``__debug__`` for *debug_override* you can override the system's value for ``__debug__`` for
extension selection. extension selection.

View File

@ -928,8 +928,8 @@ an :term:`importer`.
The ``cpython-32`` string comes from the current magic tag (see The ``cpython-32`` string comes from the current magic tag (see
:func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then :func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then
:exc:`NotImplementedError` will be raised). The returned path will end in :exc:`NotImplementedError` will be raised). The returned path will end in
``.pyc`` when ``__debug__`` is True or ``.pyo`` for an optimized Python ``.pyc`` when ``__debug__`` is ``True`` or ``.pyo`` for an optimized Python
(i.e. ``__debug__`` is False). By passing in True or False for (i.e. ``__debug__`` is ``False``). By passing in ``True`` or ``False`` for
*debug_override* you can override the system's value for ``__debug__`` for *debug_override* you can override the system's value for ``__debug__`` for
extension selection. extension selection.

View File

@ -280,7 +280,7 @@ I/O Base Classes
.. method:: readable() .. method:: readable()
Return ``True`` if the stream can be read from. If False, :meth:`read` Return ``True`` if the stream can be read from. If ``False``, :meth:`read`
will raise :exc:`OSError`. will raise :exc:`OSError`.
.. method:: readline(size=-1) .. method:: readline(size=-1)

View File

@ -51,7 +51,7 @@ Iterator Arguments Results
chain.from_iterable iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) --> A B C D E F`` chain.from_iterable iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) --> A B C D E F``
:func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F`` :func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``
:func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1`` :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``
:func:`filterfalse` pred, seq elements of seq where pred(elem) is False ``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8`` :func:`filterfalse` pred, seq elements of seq where pred(elem) is false ``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``
:func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v)
:func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] ``islice('ABCDEFG', 2, None) --> C D E F G`` :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] ``islice('ABCDEFG', 2, None) --> C D E F G``
:func:`starmap` func, seq func(\*seq[0]), func(\*seq[1]), ... ``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000`` :func:`starmap` func, seq func(\*seq[0]), func(\*seq[1]), ... ``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000``

View File

@ -843,7 +843,7 @@ supports sending logging messages to a Web server, using either ``GET`` or
Returns a new instance of the :class:`HTTPHandler` class. The *host* can be Returns a new instance of the :class:`HTTPHandler` class. The *host* can be
of the form ``host:port``, should you need to use a specific port number. of the form ``host:port``, should you need to use a specific port number.
If no *method* is specified, ``GET`` is used. If *secure* is True, an HTTPS If no *method* is specified, ``GET`` is used. If *secure* is true, an HTTPS
connection will be used. If *credentials* is specified, it should be a connection will be used. If *credentials* is specified, it should be a
2-tuple consisting of userid and password, which will be placed in an HTTP 2-tuple consisting of userid and password, which will be placed in an HTTP
'Authorization' header using Basic authentication. If you specify 'Authorization' header using Basic authentication. If you specify

View File

@ -160,7 +160,7 @@ is the module's name in the Python package namespace.
is called to get the exception information. is called to get the exception information.
The second optional keyword argument is *stack_info*, which defaults to The second optional keyword argument is *stack_info*, which defaults to
False. If specified as True, stack information is added to the logging ``False``. If true, stack information is added to the logging
message, including the actual logging call. Note that this is not the same message, including the actual logging call. Note that this is not the same
stack information as that displayed through specifying *exc_info*: The stack information as that displayed through specifying *exc_info*: The
former is stack frames from the bottom of the stack up to the logging call former is stack frames from the bottom of the stack up to the logging call
@ -308,7 +308,7 @@ is the module's name in the Python package namespace.
Checks to see if this logger has any handlers configured. This is done by Checks to see if this logger has any handlers configured. This is done by
looking for handlers in this logger and its parents in the logger hierarchy. looking for handlers in this logger and its parents in the logger hierarchy.
Returns True if a handler was found, else False. The method stops searching Returns ``True`` if a handler was found, else ``False``. The method stops searching
up the hierarchy whenever a logger with the 'propagate' attribute set to up the hierarchy whenever a logger with the 'propagate' attribute set to
False is found - that will be the last logger which is checked for the False is found - that will be the last logger which is checked for the
existence of handlers. existence of handlers.
@ -878,7 +878,7 @@ functions.
is called to get the exception information. is called to get the exception information.
The second optional keyword argument is *stack_info*, which defaults to The second optional keyword argument is *stack_info*, which defaults to
False. If specified as True, stack information is added to the logging ``False``. If true, stack information is added to the logging
message, including the actual logging call. Note that this is not the same message, including the actual logging call. Note that this is not the same
stack information as that displayed through specifying *exc_info*: The stack information as that displayed through specifying *exc_info*: The
former is stack frames from the bottom of the stack up to the logging call former is stack frames from the bottom of the stack up to the logging call

View File

@ -232,7 +232,7 @@ Compressing and decompressing data in memory
.. attribute:: eof .. attribute:: eof
True if the end-of-stream marker has been reached. ``True`` if the end-of-stream marker has been reached.
.. attribute:: unused_data .. attribute:: unused_data

View File

@ -162,7 +162,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
.. attribute:: closed .. attribute:: closed
True if the file is closed. ``True`` if the file is closed.
.. versionadded:: 3.2 .. versionadded:: 3.2

View File

@ -82,7 +82,7 @@ The module itself defines the following classes:
.. versionchanged:: 3.2 .. versionchanged:: 3.2
*usenetrc* is now False by default. *usenetrc* is now ``False`` by default.
.. versionchanged:: 3.3 .. versionchanged:: 3.3
Support for the :keyword:`with` statement was added. Support for the :keyword:`with` statement was added.
@ -216,7 +216,7 @@ tuples or objects that the method normally returns will be empty.
.. method:: NNTP.login(user=None, password=None, usenetrc=True) .. method:: NNTP.login(user=None, password=None, usenetrc=True)
Send ``AUTHINFO`` commands with the user name and password. If *user* Send ``AUTHINFO`` commands with the user name and password. If *user*
and *password* are None and *usenetrc* is True, credentials from and *password* are None and *usenetrc* is true, credentials from
``~/.netrc`` will be used if possible. ``~/.netrc`` will be used if possible.
Unless intentionally delayed, login is normally performed during the Unless intentionally delayed, login is normally performed during the

View File

@ -137,7 +137,7 @@ the :mod:`glob` module.)
the number of seconds since the epoch (see the :mod:`time` module). Raise the number of seconds since the epoch (see the :mod:`time` module). Raise
:exc:`OSError` if the file does not exist or is inaccessible. :exc:`OSError` if the file does not exist or is inaccessible.
If :func:`os.stat_float_times` returns True, the result is a floating point If :func:`os.stat_float_times` returns ``True``, the result is a floating point
number. number.
@ -147,7 +147,7 @@ the :mod:`glob` module.)
giving the number of seconds since the epoch (see the :mod:`time` module). giving the number of seconds since the epoch (see the :mod:`time` module).
Raise :exc:`OSError` if the file does not exist or is inaccessible. Raise :exc:`OSError` if the file does not exist or is inaccessible.
If :func:`os.stat_float_times` returns True, the result is a floating point If :func:`os.stat_float_times` returns ``True``, the result is a floating point
number. number.
@ -340,5 +340,5 @@ the :mod:`glob` module.)
.. data:: supports_unicode_filenames .. data:: supports_unicode_filenames
True if arbitrary Unicode strings can be used as file names (within limitations ``True`` if arbitrary Unicode strings can be used as file names (within limitations
imposed by the file system). imposed by the file system).

View File

@ -551,7 +551,7 @@ process and user.
.. data:: supports_bytes_environ .. data:: supports_bytes_environ
True if the native OS type of the environment is bytes (eg. False on ``True`` if the native OS type of the environment is bytes (eg. ``False`` on
Windows). Windows).
.. versionadded:: 3.2 .. versionadded:: 3.2

View File

@ -161,7 +161,7 @@ process more convenient:
:class:`io.BytesIO` instance, or any other custom object that meets this :class:`io.BytesIO` instance, or any other custom object that meets this
interface. interface.
If *fix_imports* is True and *protocol* is less than 3, pickle will try to If *fix_imports* is true and *protocol* is less than 3, pickle will try to
map the new Python 3.x names to the old module names used in Python 2.x, map the new Python 3.x names to the old module names used in Python 2.x,
so that the pickle data stream is readable with Python 2.x. so that the pickle data stream is readable with Python 2.x.
@ -178,7 +178,7 @@ process more convenient:
supported. The higher the protocol used, the more recent the version of supported. The higher the protocol used, the more recent the version of
Python needed to read the pickle produced. Python needed to read the pickle produced.
If *fix_imports* is True and *protocol* is less than 3, pickle will try to If *fix_imports* is true and *protocol* is less than 3, pickle will try to
map the new Python 3.x names to the old module names used in Python 2.x, map the new Python 3.x names to the old module names used in Python 2.x,
so that the pickle data stream is readable with Python 2.x. so that the pickle data stream is readable with Python 2.x.
@ -200,7 +200,7 @@ process more convenient:
Optional keyword arguments are *fix_imports*, *encoding* and *errors*, Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream generated which are used to control compatibility support for pickle stream generated
by Python 2.x. If *fix_imports* is True, pickle will try to map the old by Python 2.x. If *fix_imports* is true, pickle will try to map the old
Python 2.x names to the new names used in Python 3.x. The *encoding* and Python 2.x names to the new names used in Python 3.x. The *encoding* and
*errors* tell pickle how to decode 8-bit string instances pickled by Python *errors* tell pickle how to decode 8-bit string instances pickled by Python
2.x; these default to 'ASCII' and 'strict', respectively. 2.x; these default to 'ASCII' and 'strict', respectively.
@ -216,7 +216,7 @@ process more convenient:
Optional keyword arguments are *fix_imports*, *encoding* and *errors*, Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream generated which are used to control compatibility support for pickle stream generated
by Python 2.x. If *fix_imports* is True, pickle will try to map the old by Python 2.x. If *fix_imports* is true, pickle will try to map the old
Python 2.x names to the new names used in Python 3.x. The *encoding* and Python 2.x names to the new names used in Python 3.x. The *encoding* and
*errors* tell pickle how to decode 8-bit string instances pickled by Python *errors* tell pickle how to decode 8-bit string instances pickled by Python
2.x; these default to 'ASCII' and 'strict', respectively. 2.x; these default to 'ASCII' and 'strict', respectively.
@ -266,7 +266,7 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
argument. It can thus be an on-disk file opened for binary writing, a argument. It can thus be an on-disk file opened for binary writing, a
:class:`io.BytesIO` instance, or any other custom object that meets this interface. :class:`io.BytesIO` instance, or any other custom object that meets this interface.
If *fix_imports* is True and *protocol* is less than 3, pickle will try to If *fix_imports* is true and *protocol* is less than 3, pickle will try to
map the new Python 3.x names to the old module names used in Python 2.x, map the new Python 3.x names to the old module names used in Python 2.x,
so that the pickle data stream is readable with Python 2.x. so that the pickle data stream is readable with Python 2.x.
@ -336,7 +336,7 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
Optional keyword arguments are *fix_imports*, *encoding* and *errors*, Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream generated which are used to control compatibility support for pickle stream generated
by Python 2.x. If *fix_imports* is True, pickle will try to map the old by Python 2.x. If *fix_imports* is true, pickle will try to map the old
Python 2.x names to the new names used in Python 3.x. The *encoding* and Python 2.x names to the new names used in Python 3.x. The *encoding* and
*errors* tell pickle how to decode 8-bit string instances pickled by Python *errors* tell pickle how to decode 8-bit string instances pickled by Python
2.x; these default to 'ASCII' and 'strict', respectively. 2.x; these default to 'ASCII' and 'strict', respectively.

View File

@ -54,7 +54,7 @@ This module defines the following functions:
* :data:`FMT_BINARY`: Binary plist format * :data:`FMT_BINARY`: Binary plist format
If *use_builtin_types* is True (the default) binary data will be returned If *use_builtin_types* is true (the default) binary data will be returned
as instances of :class:`bytes`, otherwise it is returned as instances of as instances of :class:`bytes`, otherwise it is returned as instances of
:class:`Data`. :class:`Data`.

View File

@ -113,7 +113,7 @@ Scheduler Objects
function passed to the constructor) for the next event, then execute it and so function passed to the constructor) for the next event, then execute it and so
on until there are no more scheduled events. on until there are no more scheduled events.
If *blocking* is False executes the scheduled events due to expire soonest If *blocking* is false executes the scheduled events due to expire soonest
(if any) and then return the deadline of the next scheduled call in the (if any) and then return the deadline of the next scheduled call in the
scheduler (if any). scheduler (if any).

View File

@ -241,10 +241,10 @@ Module functions and constants
.. function:: enable_callback_tracebacks(flag) .. function:: enable_callback_tracebacks(flag)
By default you will not get any tracebacks in user-defined functions, By default you will not get any tracebacks in user-defined functions,
aggregates, converters, authorizer callbacks etc. If you want to debug them, you aggregates, converters, authorizer callbacks etc. If you want to debug them,
can call this function with *flag* as True. Afterwards, you will get tracebacks you can call this function with *flag* set to ``True``. Afterwards, you will
from callbacks on ``sys.stderr``. Use :const:`False` to disable the feature get tracebacks from callbacks on ``sys.stderr``. Use :const:`False` to
again. disable the feature again.
.. _sqlite3-connection-objects: .. _sqlite3-connection-objects:

View File

@ -287,7 +287,7 @@ Random generation
.. function:: RAND_pseudo_bytes(num) .. function:: RAND_pseudo_bytes(num)
Returns (bytes, is_cryptographic): bytes are *num* pseudo-random bytes, Returns (bytes, is_cryptographic): bytes are *num* pseudo-random bytes,
is_cryptographic is True if the bytes generated are cryptographically is_cryptographic is ``True`` if the bytes generated are cryptographically
strong. Raises an :class:`SSLError` if the operation is not supported by the strong. Raises an :class:`SSLError` if the operation is not supported by the
current RAND method. current RAND method.
@ -300,8 +300,8 @@ Random generation
.. function:: RAND_status() .. function:: RAND_status()
Returns True if the SSL pseudo-random number generator has been seeded with Returns ``True`` if the SSL pseudo-random number generator has been seeded with
'enough' randomness, and False otherwise. You can use :func:`ssl.RAND_egd` 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl.RAND_egd`
and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random
number generator. number generator.
@ -1173,7 +1173,7 @@ to speed up repeated connections from the same clients.
.. method:: SSLContext.get_ca_certs(binary_form=False) .. method:: SSLContext.get_ca_certs(binary_form=False)
Returns a list of dicts with information of loaded CA certs. If the Returns a list of dicts with information of loaded CA certs. If the
optional argument is True, returns a DER-encoded copy of the CA optional argument is true, returns a DER-encoded copy of the CA
certificate. certificate.
.. note:: .. note::

View File

@ -2851,7 +2851,7 @@ The constructors for both classes work the same:
.. method:: isdisjoint(other) .. method:: isdisjoint(other)
Return True if the set has no elements in common with *other*. Sets are Return ``True`` if the set has no elements in common with *other*. Sets are
disjoint if and only if their intersection is the empty set. disjoint if and only if their intersection is the empty set.
.. method:: issubset(other) .. method:: issubset(other)

View File

@ -295,7 +295,7 @@ bytes.
For the ``'?'`` format character, the return value is either :const:`True` or For the ``'?'`` format character, the return value is either :const:`True` or
:const:`False`. When packing, the truth value of the argument object is used. :const:`False`. When packing, the truth value of the argument object is used.
Either 0 or 1 in the native or standard bool representation will be packed, and Either 0 or 1 in the native or standard bool representation will be packed, and
any non-zero value will be True when unpacking. any non-zero value will be ``True`` when unpacking.

View File

@ -522,7 +522,7 @@ functions.
*executable* (or for the first item in *args*) relative to *cwd* if the *executable* (or for the first item in *args*) relative to *cwd* if the
executable path is a relative path. executable path is a relative path.
If *restore_signals* is True (the default) all signals that Python has set to If *restore_signals* is true (the default) all signals that Python has set to
SIG_IGN are restored to SIG_DFL in the child process before the exec. SIG_IGN are restored to SIG_DFL in the child process before the exec.
Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals.
(Unix only) (Unix only)
@ -530,7 +530,7 @@ functions.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
*restore_signals* was added. *restore_signals* was added.
If *start_new_session* is True the setsid() system call will be made in the If *start_new_session* is true the setsid() system call will be made in the
child process prior to the execution of the subprocess. (Unix only) child process prior to the execution of the subprocess. (Unix only)
.. versionchanged:: 3.2 .. versionchanged:: 3.2

View File

@ -1067,7 +1067,7 @@ always available.
:func:`open` function. Their parameters are chosen as follows: :func:`open` function. Their parameters are chosen as follows:
* The character encoding is platform-dependent. Under Windows, if the stream * The character encoding is platform-dependent. Under Windows, if the stream
is interactive (that is, if its :meth:`isatty` method returns True), the is interactive (that is, if its :meth:`isatty` method returns ``True``), the
console codepage is used, otherwise the ANSI code page. Under other console codepage is used, otherwise the ANSI code page. Under other
platforms, the locale encoding is used (see :meth:`locale.getpreferredencoding`). platforms, the locale encoding is used (see :meth:`locale.getpreferredencoding`).

View File

@ -359,7 +359,7 @@ be finalized; only the internally used file object will be closed. See the
full name. Its file information is extracted as accurately as possible. *member* full name. Its file information is extracted as accurately as possible. *member*
may be a filename or a :class:`TarInfo` object. You can specify a different may be a filename or a :class:`TarInfo` object. You can specify a different
directory using *path*. File attributes (owner, mtime, mode) are set unless directory using *path*. File attributes (owner, mtime, mode) are set unless
*set_attrs* is False. *set_attrs* is false.
.. note:: .. note::

View File

@ -272,8 +272,8 @@ methods :meth:`tkinter.Widget.cget` and :meth:`tkinter.Widget.configure`.
.. method:: instate(statespec, callback=None, *args, **kw) .. method:: instate(statespec, callback=None, *args, **kw)
Test the widget's state. If a callback is not specified, returns True Test the widget's state. If a callback is not specified, returns ``True``
if the widget state matches *statespec* and False otherwise. If callback if the widget state matches *statespec* and ``False`` otherwise. If callback
is specified then it is called with args if widget state matches is specified then it is called with args if widget state matches
*statespec*. *statespec*.
@ -938,7 +938,7 @@ ttk.Treeview
.. method:: exists(item) .. method:: exists(item)
Returns True if the specified *item* is present in the tree. Returns ``True`` if the specified *item* is present in the tree.
.. method:: focus(item=None) .. method:: focus(item=None)
@ -1084,7 +1084,7 @@ ttk.Treeview
Ensure that *item* is visible. Ensure that *item* is visible.
Sets all of *item*'s ancestors open option to True, and scrolls the Sets all of *item*'s ancestors open option to ``True``, and scrolls the
widget if necessary so that *item* is within the visible portion of widget if necessary so that *item* is within the visible portion of
the tree. the tree.

View File

@ -1055,8 +1055,8 @@ More drawing control
Write text - the string representation of *arg* - at the current turtle Write text - the string representation of *arg* - at the current turtle
position according to *align* ("left", "center" or right") and with the given position according to *align* ("left", "center" or right") and with the given
font. If *move* is True, the pen is moved to the bottom-right corner of the font. If *move* is true, the pen is moved to the bottom-right corner of the
text. By default, *move* is False. text. By default, *move* is ``False``.
>>> turtle.write("Home = ", True, align="center") >>> turtle.write("Home = ", True, align="center")
>>> turtle.write((0,0), True) >>> turtle.write((0,0), True)
@ -1092,7 +1092,7 @@ Visibility
.. function:: isvisible() .. function:: isvisible()
Return True if the Turtle is shown, False if it's hidden. Return ``True`` if the Turtle is shown, ``False`` if it's hidden.
>>> turtle.hideturtle() >>> turtle.hideturtle()
>>> turtle.isvisible() >>> turtle.isvisible()

View File

@ -298,11 +298,11 @@ the `new_callable` argument to `patch`.
assert the mock has been called with the specified calls. assert the mock has been called with the specified calls.
The `mock_calls` list is checked for the calls. The `mock_calls` list is checked for the calls.
If `any_order` is False (the default) then the calls must be If `any_order` is false (the default) then the calls must be
sequential. There can be extra calls before or after the sequential. There can be extra calls before or after the
specified calls. specified calls.
If `any_order` is True then the calls can be in any order, but If `any_order` is true then the calls can be in any order, but
they must all appear in :attr:`mock_calls`. they must all appear in :attr:`mock_calls`.
>>> mock = Mock(return_value=None) >>> mock = Mock(return_value=None)
@ -1200,7 +1200,7 @@ patch.dict
`values` can be a dictionary of values to set in the dictionary. `values` `values` can be a dictionary of values to set in the dictionary. `values`
can also be an iterable of `(key, value)` pairs. can also be an iterable of `(key, value)` pairs.
If `clear` is True then the dictionary will be cleared before the new If `clear` is true then the dictionary will be cleared before the new
values are set. values are set.
`patch.dict` can also be called with arbitrary keyword arguments to set `patch.dict` can also be called with arbitrary keyword arguments to set

View File

@ -59,7 +59,7 @@ The :mod:`urllib.request` module defines the following functions:
some non-Windows platforms. some non-Windows platforms.
.. warning:: .. warning::
If neither *cafile* nor *capath* is specified, and *cadefault* is False, If neither *cafile* nor *capath* is specified, and *cadefault* is ``False``,
an HTTPS request will not do any verification of the server's an HTTPS request will not do any verification of the server's
certificate. certificate.
@ -211,7 +211,7 @@ The following classes are provided:
containing the image. containing the image.
*unverifiable* should indicate whether the request is unverifiable, *unverifiable* should indicate whether the request is unverifiable,
as defined by RFC 2965. It defaults to False. An unverifiable as defined by RFC 2965. It defaults to ``False``. An unverifiable
request is one whose URL the user did not have the option to request is one whose URL the user did not have the option to
approve. For example, if the request is for an image in an HTML approve. For example, if the request is for an image in an HTML
document, and the user had no option to approve the automatic document, and the user had no option to approve the automatic

View File

@ -94,7 +94,7 @@ creation according to their needs, the :class:`EnvBuilder` class.
* ``system_site_packages`` -- a Boolean value indicating that the system Python * ``system_site_packages`` -- a Boolean value indicating that the system Python
site-packages should be available to the environment (defaults to ``False``). site-packages should be available to the environment (defaults to ``False``).
* ``clear`` -- a Boolean value which, if True, will delete the contents of * ``clear`` -- a Boolean value which, if true, will delete the contents of
any existing target directory, before creating the environment. any existing target directory, before creating the environment.
* ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the * ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the
@ -102,11 +102,11 @@ creation according to their needs, the :class:`EnvBuilder` class.
e.g. ``pythonw.exe``), rather than copying. Defaults to ``True`` on Linux and e.g. ``pythonw.exe``), rather than copying. Defaults to ``True`` on Linux and
Unix systems, but ``False`` on Windows. Unix systems, but ``False`` on Windows.
* ``upgrade`` -- a Boolean value which, if True, will upgrade an existing * ``upgrade`` -- a Boolean value which, if true, will upgrade an existing
environment with the running Python - for use when that Python has been environment with the running Python - for use when that Python has been
upgraded in-place (defaults to ``False``). upgraded in-place (defaults to ``False``).
* ``with_pip`` -- a Boolean value which, if True, ensures pip is * ``with_pip`` -- a Boolean value which, if true, ensures pip is
installed in the virtual environment installed in the virtual environment
.. versionchanged:: 3.4 .. versionchanged:: 3.4

View File

@ -411,7 +411,7 @@ The :class:`PyZipFile` constructor takes the same parameters as the
name as a file path, and if any subdirectories are package directories, name as a file path, and if any subdirectories are package directories,
all of these are added recursively. *basename* is intended for internal all of these are added recursively. *basename* is intended for internal
use only. When *filterfunc(pathname)* is given, it will be called for every use only. When *filterfunc(pathname)* is given, it will be called for every
invocation. When it returns a False value, that path and its subpaths will invocation. When it returns a false value, that path and its subpaths will
be ignored. be ignored.
The :meth:`writepy` method makes archives with file names like The :meth:`writepy` method makes archives with file names like
this:: this::

View File

@ -111,7 +111,7 @@ zipimporter Objects
.. method:: is_package(fullname) .. method:: is_package(fullname)
Return True if the module specified by *fullname* is a package. Raise Return ``True`` if the module specified by *fullname* is a package. Raise
:exc:`ZipImportError` if the module couldn't be found. :exc:`ZipImportError` if the module couldn't be found.

View File

@ -201,7 +201,7 @@ Ellipsis
single: True single: True
These represent the truth values False and True. The two objects representing These represent the truth values False and True. The two objects representing
the values False and True are the only Boolean objects. The Boolean type is a the values ``False`` and ``True`` are the only Boolean objects. The Boolean type is a
subtype of the integer type, and Boolean values behave like the values 0 and 1, subtype of the integer type, and Boolean values behave like the values 0 and 1,
respectively, in almost all contexts, the exception being that when converted to respectively, in almost all contexts, the exception being that when converted to
a string, the strings ``"False"`` or ``"True"`` are returned, respectively. a string, the strings ``"False"`` or ``"True"`` are returned, respectively.

View File

@ -1125,7 +1125,7 @@ Features
* If Python is compiled without threads, the C version automatically * If Python is compiled without threads, the C version automatically
disables the expensive thread local context machinery. In this case, disables the expensive thread local context machinery. In this case,
the variable :data:`~decimal.HAVE_THREADS` is set to False. the variable :data:`~decimal.HAVE_THREADS` is set to ``False``.
API changes API changes
~~~~~~~~~~~ ~~~~~~~~~~~

View File

@ -45,6 +45,12 @@ Build
pythoncore sub-project. This should prevent build errors due a previous pythoncore sub-project. This should prevent build errors due a previous
build's python(_d).exe still running. build's python(_d).exe still running.
Documentation
-------------
- Issue #19795: Improved markup of True/False constants.
What's New in Python 3.4.0 Beta 1? What's New in Python 3.4.0 Beta 1?
================================== ==================================