Skip to content

merge queue: checking main (e6ef84a) and #680 together - #690

Closed
mergify[bot] wants to merge 3 commits into
mainfrom
mergify/merge-queue/c2aea0f161
Closed

merge queue: checking main (e6ef84a) and #680 together#690
mergify[bot] wants to merge 3 commits into
mainfrom
mergify/merge-queue/c2aea0f161

Conversation

@mergify

@mergify mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request has been checked successfully and will be merged soon. 🎉

Branch main (e6ef84a) and #680 are queued together for merge.

This pull request has been created by Mergify to check the mergeability of #680.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.

Required conditions of queue rule default for merge:

Required conditions to stay in the queue:

---
checking_base_sha: e6ef84a1cebc01963106b1aecd598393054e0277
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 680
    scopes: []
scopes: []
...

jd and others added 3 commits August 5, 2026 17:45
`truthy-bool` reports objects tested for truthiness that implement neither
`__bool__` nor `__len__`, and so can only ever be true. Three sites:

`BaseRetrying._run_wait` and `AsyncRetrying._run_wait` both guarded the
wait call with `if self.wait:`. `wait` is typed `WaitBaseT` and defaults to
a `wait_none()` instance, so it is never falsy and the `sleep = 0.0` branch
has been dead since 17aefd9 -- a leftover from when the surrounding code
still used `if self.after is not None:` style guards. Call `self.wait`
unconditionally.

`if tornado:` guarded the optional import in two places. mypy only ever
sees the `try` branch, so it resolves the name to the module and reads the
test as always-true. Compute `_HAS_TORNADO` once and branch on that
instead; this also keeps `tornado.gen` fully typed, which annotating the
name as `ModuleType | None` would have thrown away.

Change-Id: Icb9981f6797707e070dc2423015f2fbf6c94e4c4
`mutable-override` rejects narrowing a mutable attribute in a subclass:
`RetryAction.REPR_FIELDS = ("sleep",)` inferred `tuple[str]` against the
base's `Sequence[str]`, and `NAME = "retry"` inferred `str` against
`str | None`. Both are unsound in general -- code holding a `BaseAction`
could assign a longer sequence or `None` through the base type.

`BaseAction`'s docstring already calls these class variables, so mark them
`ClassVar` and repeat the base annotation on the override. This documents
the extension point for subclasses outside tenacity too, which hit the
same error when they type check strictly.

Change-Id: I012caeaad2f93327c69467776a53e87c573b6403
@mergify mergify Bot closed this Aug 5, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/c2aea0f161 branch August 5, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant