]> granicus.if.org Git - python/commitdiff
Issue 24180: Document sys.(set|get)_coroutine_wrapper
authorYury Selivanov <yselivanov@sprymix.com>
Sun, 31 May 2015 21:13:08 +0000 (17:13 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Sun, 31 May 2015 21:13:08 +0000 (17:13 -0400)
Doc/library/sys.rst

index 3080b6944599d2884a7ee84227d7644727346674..3e8fd82aa7272940473f932d6803c39ab609bc93 100644 (file)
@@ -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