8000 refactoring: ♻️ `scope.py` by remimd · Pull Request #223 · 100nm/python-injection · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactoring: ♻️ scope.py #223

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged

refactoring: ♻️ scope.py #223

merged 1 commit into from
Mar 31, 2025

Conversation

remimd
Copy link
Contributor
@remimd remimd commented Mar 31, 2025

No description provided.

@remimd remimd requested a review from Copilot March 31, 2025 09:08
@remimd remimd self-assigned this Mar 31, 2025
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the scope management implementation in scope.py by replacing the previous _ScopeState class with a new ScopeState protocol and two concrete implementations for contextual and shared scopes. Key changes include updating import statements, redefining scope state classes with appropriate bindings, and modifying the get_scope and get_active_scopes functions to handle scope retrieval and binding more uniformly.

Comments suppressed due to low confidence (2)

injection/_core/scope.py:142

  • Consider adding explicit type annotations for the parameters 'name' and 'default' in get_scope to align with the overloads and enhance type safety.
def get_scope(name, default=...):  # type: ignore[no-untyped-def]

injection/_core/scope.py:126

  • [nitpick] The variable name 'active_scopes' in get_active_scopes may cause confusion with the active_scopes property; consider renaming it (e.g., 'scopes_iter') for improved clarity.
active_scopes = (

@remimd remimd merged commit e033786 into dev Mar 31, 2025
5 checks passed
@remimd remimd deleted the scope branch March 31, 2025 09:15
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
0