diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/enum.rst | 5 | ||||
-rw-r--r-- | Doc/library/itertools.rst | 4 | ||||
-rw-r--r-- | Doc/library/os.rst | 2 | ||||
-rw-r--r-- | Doc/library/profile.rst | 8 | ||||
-rw-r--r-- | Doc/library/test.rst | 5 | ||||
-rw-r--r-- | Doc/library/unittest.rst | 5 | ||||
-rw-r--r-- | Doc/using/cmdline.rst | 16 |
7 files changed, 24 insertions, 21 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 3661469..236275d 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -38,7 +38,8 @@ follows:: ... blue = 3 ... -..note: Nomenclature +.. note:: Nomenclature + - The class :class:`Color` is an *enumeration* (or *enum*) - The attributes :attr:`Color.red`, :attr:`Color.green`, etc., are *enumeration members* (or *enum members*). @@ -474,7 +475,7 @@ Some rules: 4. %-style formatting: `%s` and `%r` call :class:`Enum`'s :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type. -5. :class:`str`.:meth:`__format__` (or :func:`format`) will use the mixed-in +5. :meth:`str.__format__` (or :func:`format`) will use the mixed-in type's :meth:`__format__`. If the :class:`Enum`'s :func:`str` or :func:`repr` is desired use the `!s` or `!r` :class:`str` format codes. diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 0ee93ed..25f34bf 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -48,6 +48,7 @@ Iterator Arguments Results ==================== ============================ ================================================= ============================================================= :func:`accumulate` p [,func] p0, p0+p1, p0+p1+p2, ... ``accumulate([1,2,3,4,5]) --> 1 3 6 10 15`` :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('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:`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`` @@ -156,9 +157,8 @@ loops that truncate the stream. .. classmethod:: chain.from_iterable(iterable) Alternate constructor for :func:`chain`. Gets chained inputs from a - single iterable argument that is evaluated lazily. Equivalent to:: + single iterable argument that is evaluated lazily. Roughly equivalent to:: - @classmethod def from_iterable(iterables): # chain.from_iterable(['ABC', 'DEF']) --> A B C D E F for it in iterables: diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 848fd16..fc909f2 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -757,8 +757,6 @@ as internal buffering of data. As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``. - Availability: Unix. - .. function:: fstat(fd) diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index 3f2a02d..aefc024 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -247,11 +247,13 @@ functions: import cProfile, pstats, io pr = cProfile.Profile() pr.enable() - ... do something ... + # ... do something ... pr.disable() s = io.StringIO() - ps = pstats.Stats(pr, stream=s) - ps.print_results() + sortby = 'cumulative' + ps = pstats.Stats(pr, stream=s).sort_stats(sortby) + ps.print_stats() + print(s.getvalue()) .. method:: enable() diff --git a/Doc/library/test.rst b/Doc/library/test.rst index bce0f64..c1270f4 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -263,12 +263,15 @@ The :mod:`test.support` module defines the following functions: Used when tests are executed by :mod:`test.regrtest`. -.. function:: findfile(filename) +.. function:: findfile(filename, subdir=None) Return the path to the file named *filename*. If no match is found *filename* is returned. This does not equal a failure since it could be the path to the file. + Setting *subdir* indicates a relative path to use to find the file + rather than looking directly in the path directories. + .. function:: run_unittest(\*classes) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 412bee7..9071227 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1674,8 +1674,7 @@ Loading and running tests A list containing 2-tuples of :class:`TestCase` instances and strings holding formatted tracebacks. Each tuple represents a test where a failure - was explicitly signalled using the :meth:`TestCase.fail\*` or - :meth:`TestCase.assert\*` methods. + was explicitly signalled using the :meth:`TestCase.assert\*` methods. .. attribute:: skipped @@ -1772,7 +1771,7 @@ Loading and running tests .. method:: addError(test, err) - Called when the test case *test* raises an unexpected exception *err* is a + Called when the test case *test* raises an unexpected exception. *err* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index c14f6c7..908a17c 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -511,9 +511,9 @@ conflict. .. envvar:: PYTHONDONTWRITEBYTECODE - If this is set, Python won't try to write ``.pyc`` or ``.pyo`` files on the - import of source modules. This is equivalent to specifying the :option:`-B` - option. + If this is set to a non-empty string, Python won't try to write ``.pyc`` or + ``.pyo`` files on the import of source modules. This is equivalent to + specifying the :option:`-B` option. .. envvar:: PYTHONHASHSEED @@ -582,11 +582,11 @@ conflict. .. envvar:: PYTHONFAULTHANDLER - If this environment variable is set, :func:`faulthandler.enable` is called - at startup: install a handler for :const:`SIGSEGV`, :const:`SIGFPE`, - :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` signals to dump the - Python traceback. This is equivalent to :option:`-X` ``faulthandler`` - option. + If this environment variable is set to a non-empty string, + :func:`faulthandler.enable` is called at startup: install a handler for + :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and + :const:`SIGILL` signals to dump the Python traceback. This is equivalent to + :option:`-X` ``faulthandler`` option. .. versionadded:: 3.3 |