Skip to content

Annotate Connection._reverse_mapping as ClassVar - #1543

Merged
mhils merged 1 commit into
mainfrom
fix-ruff-ruf012
Oct 28, 2026
Merged

mhils merged 1 commit into
mainfrom
fix-ruff-ruf012

Conversation

@reaperhulk

Copy link
Copy Markdown
Member

The lint job is failing on main-based PRs (e.g. #1542) because a newer ruff release (0.17.x) reports RUF012 (mutable default value for class attribute) on Connection._reverse_mapping in src/OpenSSL/SSL.py.

_reverse_mapping is meant to be shared across the class, so this annotates it as typing.ClassVar[...], the same way _methods is already annotated in the same file.

Verified locally: nox -s lint fails on main with ruff 0.17.3 and passes with this change; nox -s mypy passes.


Generated by Claude Code

Newer ruff releases flag this with RUF012.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ajQWxWvcwZnJxiFJP2M59
@mhils
mhils merged commit 1487da3 into main Oct 28, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants