diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 593c26074d..2f7eca86de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,13 +14,13 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.291 + rev: v0.0.292 hooks: - id: ruff types: [file] types_or: [python, pyi, toml] - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell diff --git a/docs/source/history.rst b/docs/source/history.rst index 24eeb57261..f1baffbea7 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -265,7 +265,7 @@ Headline features Features ~~~~~~~~ -- To speed up `trio.to_thread.run_sync`, Trio now caches and re-uses +- To speed up `trio.to_thread.run_sync`, Trio now caches and reuses worker threads. And in case you have some exotic use case where you need to spawn @@ -419,7 +419,7 @@ Features If you're using higher-level interfaces outside of the `trio.hazmat ` module, then you don't need to worry about any of this; those - intefaces already take care of calling `~trio.lowlevel.notify_closing` + interfaces already take care of calling `~trio.lowlevel.notify_closing` for you. (`#1272 `__) diff --git a/docs/source/reference-core.rst b/docs/source/reference-core.rst index a82e7c5ed2..fc74ccd613 100644 --- a/docs/source/reference-core.rst +++ b/docs/source/reference-core.rst @@ -330,9 +330,9 @@ they might find it easier to work with absolute deadlines instead of relative timeouts. If they're the ones calling into the cancellation machinery, then they get to pick, and you don't have to worry about it. Second, and more importantly, this makes it easier for others to -re-use your code. If you write a ``http_get`` function, and then I -come along later and write a ``log_in_to_twitter`` function that needs -to internally make several ``http_get`` calls, I don't want to have to +reuse your code. If you write a ``http_get`` function, and then I come +along later and write a ``log_in_to_twitter`` function that needs to +internally make several ``http_get`` calls, I don't want to have to figure out how to configure the individual timeouts on each of those calls – and with Trio's timeout system, it's totally unnecessary. diff --git a/docs/source/reference-io.rst b/docs/source/reference-io.rst index 2aa8f42925..d0525e39d4 100644 --- a/docs/source/reference-io.rst +++ b/docs/source/reference-io.rst @@ -444,7 +444,7 @@ Socket objects has begun. If :meth:`connect` is cancelled, and is unable to abort the connection attempt, then it will: - 1. forcibly close the socket to prevent accidental re-use + 1. forcibly close the socket to prevent accidental reuse 2. raise :exc:`~trio.Cancelled`. tl;dr: if :meth:`connect` is cancelled then the socket is diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index 0584446fb7..40eafd2833 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -1043,7 +1043,7 @@ available; ``receive_some`` returns as soon as *any* data is available. If ``data`` is small, then our operating systems / network / server will *probably* keep it all together in a single chunk, but there's no guarantee. If the server sends ``hello`` then we might get ``hello``, -or ``hel`` ``lo``, or ``h`` ``e`` ``l`` ``l`` ``o``, or ... bottom +or ``he`` ``llo``, or ``h`` ``e`` ``l`` ``l`` ``o``, or ... bottom line, any time we're expecting more than one byte of data, we have to be prepared to call ``receive_some`` multiple times. diff --git a/trio/_core/_thread_cache.py b/trio/_core/_thread_cache.py index 8381153576..60279c87e2 100644 --- a/trio/_core/_thread_cache.py +++ b/trio/_core/_thread_cache.py @@ -228,7 +228,7 @@ def start_thread_soon( This is a low-level, no-frills interface, very similar to using `threading.Thread` to spawn a thread directly. The main difference is - that this function tries to re-use threads when possible, so it can be + that this function tries to reuse threads when possible, so it can be a bit faster than `threading.Thread`. Worker threads have the `~threading.Thread.daemon` flag set, which means diff --git a/trio/_tests/test_testing.py b/trio/_tests/test_testing.py index 3b5a57d3ec..26d9298807 100644 --- a/trio/_tests/test_testing.py +++ b/trio/_tests/test_testing.py @@ -190,7 +190,7 @@ async def f2(seq): assert record == [("f2", 0), ("f1", 1), ("f2", 2), ("f1", 3), ("f1", 4)] seq = Sequencer() - # Catches us if we try to re-use a sequence point: + # Catches us if we try to reuse a sequence point: async with seq(0): pass with pytest.raises(RuntimeError): diff --git a/trio/_tests/type_tests/check_wraps.py b/trio/_tests/type_tests/check_wraps.py index 456aa3dffb..5692738be4 100644 --- a/trio/_tests/type_tests/check_wraps.py +++ b/trio/_tests/type_tests/check_wraps.py @@ -1,8 +1,7 @@ # https://github.com/python-trio/trio/issues/2775#issuecomment-1702267589 # (except platform independent...) -import typing_extensions - import trio +import typing_extensions async def fn(s: trio.SocketStream) -> None: diff --git a/trio/testing/_sequencer.py b/trio/testing/_sequencer.py index a6e6d8e8eb..f24e7eab1e 100644 --- a/trio/testing/_sequencer.py +++ b/trio/testing/_sequencer.py @@ -63,7 +63,7 @@ async def main(): @asynccontextmanager async def __call__(self, position: int) -> AsyncIterator[None]: if position in self._claimed: - raise RuntimeError(f"Attempted to re-use sequence point {position}") + raise RuntimeError(f"Attempted to reuse sequence point {position}") if self._broken: raise RuntimeError("sequence broken!") self._claimed.add(position)