/opt/imh/python3.13/lib/python3.13/asyncio
NameSizeModeActions
__pycache__/-0755rm
base_events.py807600644editdlrm
base_futures.py19740644editdlrm
base_subprocess.py96770644editdlrm
base_tasks.py26720644editdlrm
constants.py14130644editdlrm
coroutines.py33420644editdlrm
events.py297860644editdlrm
exceptions.py17520644editdlrm
format_helpers.py27270644editdlrm
futures.py141570644editdlrm
locks.py205800644editdlrm
log.py1240644editdlrm
mixins.py4810644editdlrm
proactor_events.py335290644editdlrm
protocols.py69570644editdlrm
queues.py101520644editdlrm
runners.py72300644editdlrm
selector_events.py482260644editdlrm
sslproto.py318690644editdlrm
staggered.py70770644editdlrm
streams.py284810644editdlrm
subprocess.py77370644editdlrm
taskgroups.py100490644editdlrm
tasks.py397570644editdlrm
threads.py7900644editdlrm
timeouts.py60620644editdlrm
transports.py108080644editdlrm
trsock.py24750644editdlrm
unix_events.py544160644editdlrm
windows_events.py326300644editdlrm
windows_utils.py50600644editdlrm
__init__.py12200644editdlrm
__main__.py61280644editdlrm
Edit: /opt/imh/python3.13/lib/python3.13/asyncio/threads.py (790B)
"""High-level support for working with threads in asyncio""" import functools import contextvars from . import events __all__ = "to_thread", async def to_thread(func, /, *args, **kwargs): """Asynchronously run function *func* in a separate thread. Any *args and **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propagated, allowing context variables from the main thread to be accessed in the separate thread. Return a coroutine that can be awaited to get the eventual result of *func*. """ loop = events.get_running_loop() ctx = contextvars.copy_context() func_call = functools.partial(ctx.run, func, *args, **kwargs) return await loop.run_in_executor(None, func_call)