Skip to content

refactoring: ♻️ scope.py#223

Merged
remimd merged 1 commit intodevfrom
scope
Mar 31, 2025
Merged

refactoring: ♻️ scope.py#223
remimd merged 1 commit intodevfrom
scope

Conversation

@remimd
Copy link
Copy Markdown
Member

@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
Copy Markdown

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.

2 participants