]> granicus.if.org Git - python/commitdiff
Issue #19795: Improved markup of True/False constants.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 29 Nov 2013 10:16:53 +0000 (12:16 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 29 Nov 2013 10:16:53 +0000 (12:16 +0200)
21 files changed:
Doc/howto/functional.rst
Doc/library/ast.rst
Doc/library/bdb.rst
Doc/library/cookielib.rst
Doc/library/ctypes.rst
Doc/library/email.message.rst
Doc/library/functions.rst
Doc/library/gc.rst
Doc/library/io.rst
Doc/library/itertools.rst
Doc/library/os.path.rst
Doc/library/sqlite3.rst
Doc/library/ssl.rst
Doc/library/stdtypes.rst
Doc/library/struct.rst
Doc/library/ttk.rst
Doc/library/turtle.rst
Doc/library/urllib2.rst
Doc/library/zipimport.rst
Doc/reference/datamodel.rst
Misc/NEWS

index 836ec6da41379457cfd5bb5e62821462886fb0a3..0ff9eeef02e9f5bcb8a35413496d454b2696296d 100644 (file)
@@ -743,8 +743,8 @@ the constructed list's ``.sort()`` method. ::
 Python wiki at http://wiki.python.org/moin/HowTo/Sorting.)
 
 The ``any(iter)`` and ``all(iter)`` built-ins look at the 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 elements are true
+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 elements are true
 values:
 
     >>> any([0,1,0])
index 4db406093650958047b1f2fa88b23c8b2a17fbdb..8adc88f7da4fd66a70ccad6f9c0668af3230e7bc 100644 (file)
@@ -257,6 +257,6 @@ and classes for traversing abstract syntax trees:
    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
    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,
    *include_attributes* can be set to ``True``.
index 1cbb8f6d5d7c5b98e50b4abb6d00e6b09c91788b..c3e1ed2ff34f9a3d572df8fe7c69600fc129b285 100644 (file)
@@ -186,17 +186,17 @@ The :mod:`bdb` module also defines two classes:
    .. method:: user_line(frame)
 
       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)
 
       This method is called from :meth:`dispatch_return` when :meth:`stop_here`
-      yields True.
+      yields ``True``.
 
    .. method:: user_exception(frame, exc_info)
 
       This method is called from :meth:`dispatch_exception` when
-      :meth:`stop_here` yields True.
+      :meth:`stop_here` yields ``True``.
 
    .. method:: do_clear(arg)
 
@@ -237,7 +237,7 @@ The :mod:`bdb` module also defines two classes:
 
    .. 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.
 
 
index 2ace5100a269ffb4962630d662002eb3771bcb8d..8029dec1aa94062914976ea4556fc375a7f41b25 100644 (file)
@@ -98,7 +98,7 @@ The following classes are provided:
    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
    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
    setting the :attr:`version` attribute of the :class:`Cookie` instance to 0.
    :class:`DefaultCookiePolicy` also provides some parameters to allow some
@@ -652,7 +652,7 @@ internal consistency, so you should know what you're doing if you do that.
 
 .. 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
@@ -663,7 +663,7 @@ internal consistency, so you should know what you're doing if you do that.
 
 .. attribute:: Cookie.discard
 
-   True if this is a session cookie.
+   ``True`` if this is a session cookie.
 
 
 .. attribute:: Cookie.comment
@@ -680,7 +680,7 @@ internal consistency, so you should know what you're doing if you do that.
 
 .. 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
    cookie-attribute in that header was 1).  This attribute is provided because
    :mod:`cookielib` may 'downgrade' RFC 2109 cookies to Netscape cookies, in
@@ -691,18 +691,18 @@ internal consistency, so you should know what you're doing if you do that.
 
 .. 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).
 
 
 .. 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
 
-   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
@@ -729,7 +729,7 @@ The :class:`Cookie` class also defines the following method:
 
 .. 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
    cookie has expired at the specified time.
 
index 882c50a99f1360a99a14a5372ff1c108ea9a34d1..c87f862e3c4a8fd6e2dee7baa7bed93d24f0acfc 100644 (file)
@@ -2351,7 +2351,7 @@ These are the fundamental ctypes data types:
 .. class:: c_bool
 
    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.
 
    .. versionadded:: 2.6
index 5076af62b59804daad09fcbc54e9b22cb79666cb..838bcf529aff2086990a32bb506e1b9eba708d8f 100644 (file)
@@ -68,7 +68,7 @@ Here are the methods of the :class:`Message` class:
 
       Return ``True`` if the message's payload is a list of sub-\
       :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)
index aabf2346bb566aa61b571ced55fa25b7cef6ff91..3b3c7ddf0cf794df38f6238f7e729af8b2d13d92 100644 (file)
@@ -47,7 +47,7 @@ available.  They are listed here in alphabetical order.
 
 .. 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::
 
       def all(iterable):
@@ -61,8 +61,8 @@ available.  They are listed here in alphabetical order.
 
 .. function:: any(iterable)
 
-   Return True if any element of the *iterable* is true.  If the iterable
-   is empty, return False.  Equivalent to::
+   Return ``True`` if any element of the *iterable* is true.  If the iterable
+   is empty, return ``False``.  Equivalent to::
 
       def any(iterable):
           for element in iterable:
index f02f09d7d04496831c9cbfabc48ecbc2d604f44d..be0063d8eb9f7b03ccc3552412153190359fa148 100644 (file)
@@ -142,8 +142,8 @@ The :mod:`gc` module provides the following functions:
 
 .. function:: is_tracked(obj)
 
-   Returns True if the object is currently tracked by the garbage collector,
-   False otherwise.  As a general rule, instances of atomic types aren't
+   Returns ``True`` if the object is currently tracked by the garbage collector,
+   ``False`` otherwise.  As a general rule, instances of atomic types aren't
    tracked and instances of non-atomic types (containers, user-defined
    objects...) are.  However, some type-specific optimizations can be present
    in order to suppress the garbage collector footprint of simple instances
index cc6cc95c86c49d0b9749b320eeeab514aed8cb48..c866c980976ceff84ebfe6bb568d62da895e510d 100644 (file)
@@ -278,7 +278,7 @@ I/O Base Classes
 
    .. 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:`IOError`.
 
    .. method:: readline(limit=-1)
index 76452811cde7b9be58d6f73ada4d5adda84fb10e..60b04b0522bc4a4e434ca882fbbc22d9e4fc27ec 100644 (file)
@@ -52,8 +52,8 @@ Iterator                Arguments                       Results
 :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:`groupby`         iterable[, keyfunc]             sub-iterators grouped by value of keyfunc(v)
-:func:`ifilter`         pred, seq                       elements of seq where pred(elem) is True            ``ifilter(lambda x: x%2, range(10)) --> 1 3 5 7 9``
-:func:`ifilterfalse`    pred, seq                       elements of seq where pred(elem) is False           ``ifilterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``
+:func:`ifilter`         pred, seq                       elements of seq where pred(elem) is true            ``ifilter(lambda x: x%2, range(10)) --> 1 3 5 7 9``
+:func:`ifilterfalse`    pred, seq                       elements of seq where pred(elem) is false           ``ifilterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``
 :func:`islice`          seq, [start,] stop [, step]     elements from seq[start:stop:step]                  ``islice('ABCDEFG', 2, None) --> C D E F G``
 :func:`imap`            func, p, q, ...                 func(p0, q0), func(p1, q1), ...                     ``imap(pow, (2,3,10), (5,2,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``
index 0deb0fb26a3bf72d50e649acd7d1a3cb864a12f6..3cc60cbbf9b931939f1ca0f4e9d8260b20c9bc72 100644 (file)
@@ -127,7 +127,7 @@ the :mod:`glob` module.)
    .. versionadded:: 1.5.2
 
    .. versionchanged:: 2.3
-      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.
 
 
@@ -140,7 +140,7 @@ the :mod:`glob` module.)
    .. versionadded:: 1.5.2
 
    .. versionchanged:: 2.3
-      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.
 
 
@@ -345,7 +345,7 @@ the :mod:`glob` module.)
 
 .. 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).
 
    .. versionadded:: 2.3
index 6ca50d8a553479601a97c0d6b9820a9b9961af98..d52cbb0b246f809ea6219407ad51383c9a1e8181 100644 (file)
@@ -234,10 +234,10 @@ Module functions and constants
 .. function:: enable_callback_tracebacks(flag)
 
    By default you will not get any tracebacks in user-defined functions,
-   aggregates, converters, authorizer callbacks etc. If you want to debug them, you
-   can call this function with *flag* as True. Afterwards, you will get tracebacks
-   from callbacks on ``sys.stderr``. Use :const:`False` to disable the feature
-   again.
+   aggregates, converters, authorizer callbacks etc. If you want to debug them,
+   you can call this function with *flag* set to ``True``. Afterwards, you will
+   get tracebacks from callbacks on ``sys.stderr``. Use :const:`False` to
+   disable the feature again.
 
 
 .. _sqlite3-connection-objects:
index fe653b4015ece06ea64c4f833d34d0383a4da329..5b737679649f578e88885587e82a0392974ca234 100644 (file)
@@ -166,7 +166,7 @@ Functions, Constants, and Exceptions
 
 .. 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`
    and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random
    number generator.
index 1e6394bdb1482fb2f4a5856df1fa03d1184ea5bb..accf3824815bc677beb1f53e4299219c78e6895d 100644 (file)
@@ -1783,7 +1783,7 @@ The constructors for both classes work the same:
 
    .. 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.
 
       .. versionadded:: 2.6
index 0016fcb991ddacc9b0cdafe84bbb41b45e6ff4d2..74e320635d85b257c04ae231d5e9af8da95d0c34 100644 (file)
@@ -284,7 +284,7 @@ platforms use 32-bit pointers and will use a Python integer.
 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.
 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.
 
 
 
index f96111de218b4840c22f9544501bc057a379a419..6cab3e026c74ad18bfd0fbedc5b56df071db7e15 100644 (file)
@@ -267,8 +267,8 @@ Besides the methods described below, the :class:`ttk.Widget` class supports the
 
    .. method:: instate(statespec, callback=None, *args, **kw)
 
-      Test the widget's state. If a callback is not specified, returns True
-      if the widget state matches *statespec* and False otherwise. If callback
+      Test the widget's state. If a callback is not specified, returns ``True``
+      if the widget state matches *statespec* and ``False`` otherwise. If callback
       is specified then it is called with *args* if widget state matches
       *statespec*.
 
@@ -919,7 +919,7 @@ ttk.Treeview
 
    .. 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])
@@ -1065,7 +1065,7 @@ ttk.Treeview
 
       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
       the tree.
 
index c9bdfea7a8df871d33d3bc0ad6512899ca014266..f04a07a4dfb48bbbc464072a95983bbfdf55df4a 100644 (file)
@@ -1049,8 +1049,8 @@ More drawing control
 
    Write text - the string representation of *arg* - at the current turtle
    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
-   text.  By default, *move* is False.
+   font.  If *move* is true, the pen is moved to the bottom-right corner of the
+   text.  By default, *move* is ``False``.
 
    >>> turtle.write("Home = ", True, align="center")
    >>> turtle.write((0,0), True)
@@ -1086,7 +1086,7 @@ Visibility
 
 .. 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.isvisible()
index a35f1751c2fe66763efa88a430887bce0ac5b257..d80a1a2d6e9bf9a71294fc8ab129229a646ee7ef 100644 (file)
@@ -166,7 +166,7 @@ The following classes are provided:
    should be the request-host of the request for the page containing the image.
 
    *unverifiable* should indicate whether the request is unverifiable, as defined
-   by RFC 2965.  It defaults to False.  An unverifiable request is one whose URL
+   by RFC 2965.  It defaults to ``False``.  An unverifiable 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 document, and the user had no option to approve the
    automatic fetching of the image, this should be true.
index 450f93a97c9ee8b77d67fb2a78aabb9084e2d4ca..828e9fcfcf2b55aebda6922a70ca4b90361c9ebb 100644 (file)
@@ -115,7 +115,7 @@ zipimporter Objects
 
    .. 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.
 
 
index b57b65e7acbfdfc195cfe469a3b21eda3dc3496f..adb9d31062c907283195d739b045a112d6b9c7d3 100644 (file)
@@ -207,7 +207,7 @@ Ellipsis
             single: True
 
          These represent the truth values False and True.  The two objects
-         representing the values False and True are the only Boolean objects.
+         representing the values ``False`` and ``True`` are the only Boolean objects.
          The Boolean type is a subtype of plain integers, and Boolean values
          behave like the values 0 and 1, respectively, in almost all contexts,
          the exception being that when converted to a string, the strings
index c1e4e6a0b31bd67748e0f5ad2f85f464269e8d7c..970dca45d21df776b9bc1a80a2b2c21f850137e3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,11 @@ Tests
 
 - Issue #19085: Added basic tests for all tkinter widget options.
 
+Documentation
+-------------
+
+- Issue #19795: Improved markup of True/False constants.
+
 
 Whats' New in Python 2.7.6?
 ===========================