Skip to content

Commit 971f5b8

Browse files
committed
Document async context manager
1 parent 85f5c21 commit 971f5b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pydispatch/dispatch.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,16 @@ def on_my_event(value):
184184
name (str): The name of the :class:`Event` or :class:`Property`
185185
186186
Returns:
187-
A context manager to be used by the ``with`` statement
187+
A context manager to be used by the ``with`` statement.
188+
189+
If available, this will also be an async context manager to be used
190+
with the ``async with`` statement (see `PEP 492`_).
188191
189192
Note:
190193
The context manager is re-entrant, meaning that multiple calls to
191194
this method within nested context scopes are possible.
192195
196+
.. _PEP 492: https://www.python.org/dev/peps/pep-0492/#asynchronous-context-managers-and-async-with
193197
"""
194198
e = self.__property_events.get(name)
195199
if e is None:

0 commit comments

Comments
 (0)