From: Serhiy Storchaka Date: Wed, 19 Oct 2016 13:37:13 +0000 (+0300) Subject: Issue #19795: Mark up None as literal text. X-Git-Tag: v3.6.0b3~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=989db5c880cbe85e49857cf44daf8b6c9ccbe0b6;p=python Issue #19795: Mark up None as literal text. --- 989db5c880cbe85e49857cf44daf8b6c9ccbe0b6 diff --cc Doc/library/code.rst index 4cce1fab34,443af699f2..e2c47bab5a --- a/Doc/library/code.rst +++ b/Doc/library/code.rst @@@ -148,10 -144,6 +148,10 @@@ interpreter objects as well as the foll by the class name of the console object in parentheses (so as not to confuse this with the real interpreter -- since it's so close!). + The optional *exitmsg* argument specifies an exit message printed when exiting. + Pass the empty string to suppress the exit message. If *exitmsg* is not given or - None, a default message is printed. ++ ``None``, a default message is printed. + .. versionchanged:: 3.4 To suppress printing any banner, pass an empty string. diff --cc Doc/library/os.rst index 925a722f20,5a67f93e3c..3260cdc093 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@@ -3814,13 -3621,8 +3814,13 @@@ Miscellaneous System Informatio .. function:: cpu_count() - Return the number of CPUs in the system. Returns None if undetermined. + Return the number of CPUs in the system. Returns ``None`` if undetermined. + This number is not equivalent to the number of CPUs the current process can + use. The number of usable CPUs can be obtained with + ``len(os.sched_getaffinity(0))`` + + .. versionadded:: 3.4 diff --cc Doc/library/socket.rst index 6909a64c37,79c7609e54..9671857fc3 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@@ -1387,14 -1331,11 +1387,14 @@@ to sockets Set the value of the given socket option (see the Unix manual page :manpage:`setsockopt(2)`). The needed symbolic constants are defined in the - :mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer or - a :term:`bytes-like object` representing a buffer. In the latter case it is - up to the caller to - ensure that the bytestring contains the proper bits (see the optional built-in - module :mod:`struct` for a way to encode C structures as bytestrings). + :mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer, - None or a :term:`bytes-like object` representing a buffer. In the later ++ ``None`` or a :term:`bytes-like object` representing a buffer. In the later + case it is up to the caller to ensure that the bytestring contains the + proper bits (see the optional built-in module :mod:`struct` for a way to - encode C structures as bytestrings). When value is set to None, ++ encode C structures as bytestrings). When value is set to ``None``, + optlen argument is required. It's equivalent to call setsockopt C + function with optval=NULL and optlen=optlen. + .. versionchanged:: 3.5 Writable :term:`bytes-like object` is now accepted. diff --cc Doc/library/subprocess.rst index 0655dc4118,615adb23a6..773d207bca --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@@ -114,8 -104,8 +114,8 @@@ compatibility with older versions, see .. attribute:: stdout Captured stdout from the child process. A bytes sequence, or a string if - :func:`run` was called with an encoding or errors. None if stdout was not - :func:`run` was called with ``universal_newlines=True``. ``None`` if stdout - was not captured. ++ :func:`run` was called with an encoding or errors. ``None`` if stdout was not + captured. If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr will be combined in this attribute, and :attr:`stderr` will be @@@ -124,8 -114,8 +124,8 @@@ .. attribute:: stderr Captured stderr from the child process. A bytes sequence, or a string if - :func:`run` was called with an encoding or errors. None if stderr was not - :func:`run` was called with ``universal_newlines=True``. ``None`` if stderr - was not captured. ++ :func:`run` was called with an encoding or errors. ``None`` if stderr was not + captured. .. method:: check_returncode() diff --cc Doc/library/timeit.rst index 5bae33bc8f,57a4834c90..3b772765ac --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@@ -134,23 -134,6 +134,23 @@@ The module defines three convenience fu timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit() + .. method:: Timer.autorange(callback=None) + + Automatically determine how many times to call :meth:`.timeit`. + + This is a convenience function that calls :meth:`.timeit` repeatedly + so that the total time >= 0.2 second, returning the eventual + (number of loops, time taken for that number of loops). It calls + :meth:`.timeit` with *number* set to successive powers of ten (10, + 100, 1000, ...) up to a maximum of one billion, until the time taken + is at least 0.2 second, or the maximum is reached. + - If *callback* is given and is not *None*, it will be called after ++ If *callback* is given and is not ``None``, it will be called after + each trial with two arguments: ``callback(number, time_taken)``. + + .. versionadded:: 3.6 + + .. method:: Timer.repeat(repeat=3, number=1000000) Call :meth:`.timeit` a few times. diff --cc Doc/reference/datamodel.rst index 246e2e3140,b763f10eeb..9619e53d4d --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@@ -771,10 -767,7 +771,10 @@@ Custom classe dictionary containing the class's namespace; :attr:`~class.__bases__` is a tuple (possibly empty or a singleton) containing the base classes, in the order of their occurrence in the base class list; :attr:`__doc__` is the - class's documentation string, or None if undefined; - class's documentation string, or ``None`` if undefined. ++ class's documentation string, or ``None`` if undefined; + :attr:`__annotations__` (optional) is a dictionary containing + :term:`variable annotations ` collected during + class body execution. Class instances .. index::