Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dedicated method to find typed binding #8517

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

charliermarsh
Copy link
Member

Summary

We have this pattern in a bunch of places, where we find the only binding to a name (and return None) if it's bound multiple times. This PR DRYs it up into a method on SemanticModel.

@charliermarsh charliermarsh added the internal An internal refactor or improvement label Nov 6, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 41 projects)

sphinx-doc/sphinx (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ tests/test_ext_autosummary.py:157:13: PERF403 Use a dictionary comprehension instead of a for-loop

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PERF403 1 1 0 0 0

@charliermarsh charliermarsh merged commit eab8ca4 into main Nov 6, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/typing-binding branch November 6, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant