Skip to content

refactoring: Add ignore_none_type option for type standardization#290

Merged
remimd merged 2 commits intodevfrom
internal
Nov 8, 2025
Merged

refactoring: Add ignore_none_type option for type standardization#290
remimd merged 2 commits intodevfrom
internal

Conversation

@remimd
Copy link
Copy Markdown
Member

@remimd remimd commented Nov 8, 2025

No description provided.

@remimd remimd self-assigned this Nov 8, 2025
@remimd remimd requested a review from Copilot November 8, 2025 08:34
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 pull request adds support for conditionally filtering NoneType when standardizing type hints in the dependency injection system. The main purpose is to allow more fine-grained control over how NoneType is handled when registering types for injection, particularly useful for mapped scopes with optional fields.

  • Added ignore_none_type parameter to the type standardization pipeline
  • Refactored the Locator.update method to use a new __reduce_classes helper instead of mutating state
  • Updated MappedScope descriptor to ignore NoneType when reserving scoped slots for optional fields

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
injection/_core/common/type.py Added ignore_none_type parameter to standardize_types to conditionally filter NoneType, with recursive propagation
injection/_core/module.py Added ignore_none_type support throughout the injection pipeline and refactored type preprocessing to avoid mutation
injection/_core/descriptors.py Updated MappedScope to pass ignore_none_type=True when generating keys for type hints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread injection/_core/common/type.py
Comment thread injection/_core/module.py
@remimd remimd merged commit fdd8c15 into dev Nov 8, 2025
6 checks passed
@remimd remimd deleted the internal branch November 8, 2025 08:38
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