diff --git a/test-requirements.txt b/test-requirements.txt index 2ea1640ff0..adab2e00bb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,7 @@ # astor==0.8.1 # via -r test-requirements.in -astroid==2.14.1 +astroid==2.14.2 # via pylint async-generator==1.10 # via -r test-requirements.in @@ -39,6 +39,10 @@ decorator==5.1.1 # via ipython dill==0.3.6 # via pylint +exceptiongroup==1.1.0 ; python_version < "3.11" + # via + # -r test-requirements.in + # pytest flake8==4.0.1 # via -r test-requirements.in idna==3.4 @@ -121,6 +125,14 @@ sniffio==1.3.0 # via -r test-requirements.in sortedcontainers==2.4.0 # via -r test-requirements.in +tomli==2.0.1 + # via + # black + # build + # coverage + # mypy + # pylint + # pytest tomlkit==0.11.6 # via pylint traitlets==5.9.0 @@ -134,7 +146,10 @@ types-pyopenssl==23.0.0.2 ; implementation_name == "cpython" typing-extensions==4.4.0 ; implementation_name == "cpython" # via # -r test-requirements.in + # astroid + # black # mypy + # pylint wcwidth==0.2.6 # via prompt-toolkit wheel==0.38.4 diff --git a/trio/_core/_instrumentation.py b/trio/_core/_instrumentation.py index e14c1ef1e0..b133d47406 100644 --- a/trio/_core/_instrumentation.py +++ b/trio/_core/_instrumentation.py @@ -11,6 +11,7 @@ F = TypeVar("F", bound=Callable[..., Any]) + # Decorator to mark methods public. This does nothing by itself, but # trio/_tools/gen_exports.py looks for it. def _public(fn: F) -> F: diff --git a/trio/_core/_run.py b/trio/_core/_run.py index dc6ff21802..7811af172c 100644 --- a/trio/_core/_run.py +++ b/trio/_core/_run.py @@ -54,6 +54,7 @@ FnT = TypeVar("FnT", bound="Callable[..., Any]") + # Decorator to mark methods public. This does nothing by itself, but # trio/_tools/gen_exports.py looks for it. def _public(fn: FnT) -> FnT: diff --git a/trio/_core/_traps.py b/trio/_core/_traps.py index 39481c5903..aedf839a8d 100644 --- a/trio/_core/_traps.py +++ b/trio/_core/_traps.py @@ -10,6 +10,7 @@ from typing import Callable, NoReturn, Any + # Helper for the bottommost 'yield'. You can't use 'yield' inside an async # function, but you can inside a generator, and if you decorate your generator # with @types.coroutine, then it's even awaitable. However, it's still not a @@ -67,6 +68,7 @@ class WaitTaskRescheduled: RaiseCancelT = Callable[[], NoReturn] # TypeAlias + # Should always return the type a Task "expects", unless you willfully reschedule it # with a bad value. async def wait_task_rescheduled(abort_func: Callable[[RaiseCancelT], Abort]) -> Any: diff --git a/trio/_core/tests/test_guest_mode.py b/trio/_core/tests/test_guest_mode.py index a5d6d78e18..9fed232214 100644 --- a/trio/_core/tests/test_guest_mode.py +++ b/trio/_core/tests/test_guest_mode.py @@ -17,6 +17,7 @@ from .tutil import gc_collect_harder, buggy_pypy_asyncgens, restore_unraisablehook from ..._util import signal_raise + # The simplest possible "host" loop. # Nice features: # - we can run code "outside" of trio using the schedule function passed to @@ -227,6 +228,7 @@ async def sit_in_wait_all_tasks_blocked(watb_cscope): async def get_woken_by_host_deadline(watb_cscope): with trio.CancelScope() as cscope: print("scheduling stuff to happen") + # Altering the deadline from the host, to something in the # future, will cause the run loop to wake up, but then # discover that there is nothing to do and go back to sleep. diff --git a/trio/_socket.py b/trio/_socket.py index 8bfa6d265a..b12126f7e1 100644 --- a/trio/_socket.py +++ b/trio/_socket.py @@ -353,6 +353,7 @@ async def wrapper(self, *args, **kwargs): # addresses everywhere. Split out into a standalone function so it can be reused by # FakeNet. + # Take an address in Python's representation, and returns a new address in # the same representation, but with names resolved to numbers, # etc.