From dc0e3a89070a2b547a6b6b90cf30e5c1d4b30cf5 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 19 Oct 2016 18:30:16 +0300 Subject: [PATCH] Issue #19795: Improved more markups of True/False. --- Doc/c-api/number.rst | 4 ++-- Doc/library/ctypes.rst | 6 +++--- Doc/library/httplib.rst | 2 +- Doc/library/logging.rst | 12 +----------- Doc/library/ssl.rst | 2 +- Doc/library/sysconfig.rst | 2 +- Doc/library/xml.etree.elementtree.rst | 2 +- Doc/whatsnew/2.7.rst | 10 +++++----- 8 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst index 75b73416c8..39f0e78de0 100644 --- a/Doc/c-api/number.rst +++ b/Doc/c-api/number.rst @@ -316,7 +316,7 @@ Number Protocol .. c:function:: int PyIndex_Check(PyObject *o) - Returns True if *o* is an index integer (has the nb_index slot of the - tp_as_number structure filled in). + Returns ``1`` if *o* is an index integer (has the nb_index slot of the + tp_as_number structure filled in), and ``0`` otherwise. .. versionadded:: 2.5 diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 368c7856be..01d5e1ab57 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1404,7 +1404,7 @@ details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is ignored. On posix systems, RTLD_NOW is always added, and is not configurable. -The *use_errno* parameter, when set to True, enables a ctypes mechanism that +The *use_errno* parameter, when set to true, enables a ctypes mechanism that allows accessing the system :data:`errno` error number in a safe way. :mod:`ctypes` maintains a thread-local copy of the systems :data:`errno` variable; if you call foreign functions created with ``use_errno=True`` then the @@ -1415,7 +1415,7 @@ The function :func:`ctypes.get_errno` returns the value of the ctypes private copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy to a new value and returns the former value. -The *use_last_error* parameter, when set to True, enables the same mechanism for +The *use_last_error* parameter, when set to true, enables the same mechanism for the Windows error code which is managed by the :func:`GetLastError` and :func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and :func:`ctypes.set_last_error` are used to request and change the ctypes private @@ -1631,7 +1631,7 @@ type and the argument types of the function. The returned function prototype creates functions that use the standard C calling convention. The function will release the GIL during the call. If - *use_errno* is set to True, the ctypes private copy of the system + *use_errno* is set to true, the ctypes private copy of the system :data:`errno` variable is exchanged with the real :data:`errno` value before and after the call; *use_last_error* does the same for the Windows error code. diff --git a/Doc/library/httplib.rst b/Doc/library/httplib.rst index 4bf20067fa..0a9a6dc902 100644 --- a/Doc/library/httplib.rst +++ b/Doc/library/httplib.rst @@ -49,7 +49,7 @@ The module provides the following classes: server. It should be instantiated passing it a host and optional port number. If no port number is passed, the port is extracted from the host string if it has the form ``host:port``, else the default HTTP port (80) is - used. When True, the optional parameter *strict* (which defaults to a false + used. When true, the optional parameter *strict* (which defaults to a false value) causes ``BadStatusLine`` to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. If the optional *timeout* parameter is given, blocking diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 4e2948ab02..5c2f65cfba 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1026,14 +1026,4 @@ with the :mod:`warnings` module. package available from this site is suitable for use with Python 1.5.2, 2.1.x and 2.2.x, which do not include the :mod:`logging` package in the standard library. -<<<<<<< - -======= - :lno: The line number in the file where the logging call was made. - :msg: The logging message. - :args: The arguments for the logging message. - :exc_info: An exception tuple, or ``None``. - :func: The name of the function or method which invoked the logging - call. - :sinfo: A stack traceback such as is provided by ->>>>>>> + diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 130248759e..8849d0f3d7 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1246,7 +1246,7 @@ to speed up repeated connections from the same clients. This setting doesn't apply to client sockets. You can also use the :data:`OP_SINGLE_ECDH_USE` option to further improve security. - This method is not available if :data:`HAS_ECDH` is False. + This method is not available if :data:`HAS_ECDH` is ``False``. .. seealso:: `SSL/TLS & Perfect Forward Secrecy `_ diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst index 9dd0b1e8d4..e8fc09e995 100644 --- a/Doc/library/sysconfig.rst +++ b/Doc/library/sysconfig.rst @@ -152,7 +152,7 @@ identifier. Python currently uses eight paths: If *vars* is provided, it must be a dictionary of variables that will update the dictionary used to expand the paths. - If *expand* is set to False, the paths will not be expanded. + If *expand* is set to false, the paths will not be expanded. If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:`KeyError`. diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index a431b0fa22..08b677bddc 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -855,7 +855,7 @@ ElementTree Objects Writes the element tree to a file, as XML. *file* is a file name, or a file object opened for writing. *encoding* [1]_ is the output encoding (default is US-ASCII). *xml_declaration* controls if an XML declaration - should be added to the file. Use False for never, True for always, ``None`` + should be added to the file. Use ``False`` for never, ``True`` for always, ``None`` for only if not US-ASCII or UTF-8 (default is ``None``). *default_namespace* sets the default XML namespace (for "xmlns"). *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``). Returns an diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index 1b9bf3ec3f..6dd55215d6 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -245,8 +245,8 @@ Deleting an entry and reinserting it will move it to the end:: [('first', 1), ('third', 3), ('second', 5)] The :meth:`~collections.OrderedDict.popitem` method has an optional *last* -argument that defaults to True. If *last* is True, the most recently -added key is returned and removed; if it's False, the +argument that defaults to ``True``. If *last* is true, the most recently +added key is returned and removed; if it's false, the oldest key is selected:: >>> od = OrderedDict([(x,0) for x in range(20)]) @@ -1503,7 +1503,7 @@ changes, or look through the Subversion logs for all the details. * The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now supports socket timeouts and disabling the Nagle algorithm. The :attr:`~SocketServer.TCPServer.disable_nagle_algorithm` class attribute - defaults to False; if overridden to be True, + defaults to ``False``; if overridden to be true, new request connections will have the TCP_NODELAY option set to prevent buffering many small sends into a single TCP packet. The :attr:`~SocketServer.BaseServer.timeout` class attribute can hold @@ -1855,7 +1855,7 @@ The error messages for :meth:`~unittest.TestCase.assertEqual`, :meth:`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse` failures now provide more information. If you set the :attr:`~unittest.TestCase.longMessage` attribute of your :class:`~unittest.TestCase` classes to -True, both the standard error message and any additional message you +true, both the standard error message and any additional message you provide will be printed for failures. (Added by Michael Foord; :issue:`5663`.) The :meth:`~unittest.TestCase.assertRaises` method now @@ -1962,7 +1962,7 @@ GvR worked on merging them into Python's version of :mod:`unittest`. sequence comparison methods do. :func:`unittest.main` now takes an optional ``exit`` argument. If -False, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing +false, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing :func:`~unittest.main` to be used from the interactive interpreter. (Contributed by J. Pablo Fernández; :issue:`3379`.) -- 2.50.1