This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pathlib | |
| import sys | |
| import tomllib | |
| from collections.abc import Iterable | |
| def main() -> None: | |
| project = pathlib.Path("pyproject.toml") | |
| module = tomllib.loads(project.read_text())["tool"]["mypy"]["overrides"][0][ | |
| "module" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import contextlib | |
| async def child(sock): | |
| try: | |
| with contextlib.closing(sock): | |
| await asyncio.sleep(2) | |
| except Exception as e: | |
| print(f"child task got error: {type(e)=} {e=}") | |
| raise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import objgraph | |
| import asyncio | |
| READY = object() | |
| import weakref | |
| import asyncio | |
| import gc | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import collections.abc | |
| import contextlib | |
| import functools | |
| import types | |
| import httpx | |
| import sniffio | |
| import trio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import collections.abc | |
| import contextlib | |
| import functools | |
| import types | |
| import httpx | |
| import sniffio | |
| import trio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from twisted.internet import defer | |
| import curio | |
| import concurrent | |
| class Interceptor: | |
| def __init__(self, send, coro): | |
| self._send = send | |
| self._coro = coro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __all__ = 'run', | |
| import functools | |
| import asyncio | |
| from asyncio import coroutines | |
| from asyncio import events | |
| from asyncio import tasks | |
| import contextlib | |
| @contextlib.contextmanager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import contextlib | |
| class _AcknowledgeException: | |
| def __init__(self, exception): | |
| self.exception = exception | |
| class _RecommendGeneratorExit(BaseException): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import types | |
| def underline(text): | |
| last_line = text.splitlines()[-1] | |
| return text + "\n" + "^" * len(last_line) | |
| @types.coroutine | |
| def _async_yield(v): | |
| return (yield v) |