Skip to content

Conversation

remimd
Copy link
Contributor

@remimd remimd commented Jun 12, 2025

No description provided.

@remimd remimd requested a review from Copilot June 12, 2025 08:05
@remimd remimd self-assigned this Jun 12, 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 extends the container’s type standardization to handle PEP-695 style type Alias declarations and adds tests to verify that injecting type aliases (including generic ones) resolves correctly.

  • Added two new tests in test_injectable.py for plain and generic type aliases.
  • Updated __standardize_inputs to return the raw iterator from standardize_types instead of materializing a tuple.
  • Enhanced standardize_types to recursively expand TypeAliasType values.

Reviewed Changes

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

File Description
tests/test_injectable.py Added tests for injecting both simple and generic type aliases.
injection/_core/module.py Changed __standardize_inputs to return an Iterator directly.
injection/_core/common/type.py Expanded alias handling in standardize_types with recursion.
Comments suppressed due to low confidence (2)

tests/test_injectable.py:198

  • [nitpick] It would be valuable to add a test for nested type aliases (e.g. type Alias2 = Alias) to ensure recursive alias expansion works correctly.
def test_injectable_with_type_alias_type(self):

injection/_core/module.py:351

  • Switching from a tuple to a raw iterator means the result can only be consumed once. If consumers expect to iterate multiple times, consider wrapping this call in tuple() or documenting its single-use nature.
return standardize_types(*classes, with_origin=True)

remimd added 2 commits June 12, 2025 10:07
@remimd remimd merged commit 0a4f63e into dev Jun 12, 2025
5 checks passed
@remimd remimd deleted the typealiastype branch June 12, 2025 08:10
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