diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-31 21:13:08 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-31 21:13:08 (GMT) |
commit | d4cbbebe2d3659f8a83e2d8996fbe7bd0a32db26 (patch) | |
tree | 1b2077e623b7c8c207017a5453bb7bac83bbfdf3 /Doc/library/sys.rst | |
parent | f67b0a36c515a479cc2d7616fb878dfd0f2b0029 (diff) | |
download | cpython-d4cbbebe2d3659f8a83e2d8996fbe7bd0a32db26.zip cpython-d4cbbebe2d3659f8a83e2d8996fbe7bd0a32db26.tar.gz cpython-d4cbbebe2d3659f8a83e2d8996fbe7bd0a32db26.tar.bz2 |
Issue 24180: Document sys.(set|get)_coroutine_wrapper
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r-- | Doc/library/sys.rst | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 3080b69..3e8fd82 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -576,6 +576,18 @@ always available. *service_pack_major*, *suite_mask*, and *product_type*. +.. function:: get_coroutine_wrapper() + + Returns ``None``, or a wrapper set by :func:`set_coroutine_wrapper`. + + .. versionadded:: 3.5 + See :pep:`492` for more details. + + .. note:: + This function has been added on a provisional basis (see :pep:`411` + for details.) Use it only for debug purposes. + + .. data:: hash_info A :term:`struct sequence` giving parameters of the numeric hash @@ -1061,6 +1073,28 @@ always available. thus not likely to be implemented elsewhere. +.. function:: set_coroutine_wrapper(wrapper) + + Allows to intercept creation of :term:`coroutine` objects. + + *wrapper* must be either: + + * a callable that accepts one argument (a coroutine object); + * ``None``, to reset the wrapper. + + If called twice, the new wrapper replaces the previous one. The function + is thread-specific. + + See also :func:`get_coroutine_wrapper`. + + .. versionadded:: 3.5 + See :pep:`492` for more details. + + .. note:: + This function has been added on a provisional basis (see :pep:`411` + for details.) Use it only for debug purposes. + + .. data:: stdin stdout stderr |