Skip to content

feat: ✨ Improve decorator type hints#263

Merged
remimd merged 1 commit intodevfrom
hints
Jun 14, 2025
Merged

feat: ✨ Improve decorator type hints#263
remimd merged 1 commit intodevfrom
hints

Conversation

@remimd
Copy link
Copy Markdown
Member

@remimd remimd commented Jun 14, 2025

No description provided.

@remimd remimd requested a review from Copilot June 14, 2025 11:22
@remimd remimd self-assigned this Jun 14, 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 improves the decorator type hints and overloads for various dependency injection decorators.

  • Introduces overloads for the autocall decorator in injection/entrypoint.py.
  • Replaces Iterable with Sequence in the type definitions and updates overload signatures for inject, injectable, singleton, and constant in init.pyi.

Reviewed Changes

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

File Description
injection/entrypoint.py Updated autocall decorator with overloads and type annotations.
injection/_core/common/type.py Replaces Iterable with Sequence in type hints for TypeInfo.
injection/init.pyi Adds multiple overloads with improved type hints for dependency injection decorators.
Comments suppressed due to low confidence (2)

injection/entrypoint.py:38

  • The autocall decorator's inner function calls wp() without parameters, which assumes that the wrapped function takes no arguments. Consider clarifying this behavior in the documentation or enforcing that only parameterless functions are allowed.
wp()

injection/_core/common/type.py:30

  • Replacing Iterable with Sequence may restrict acceptable input types. Confirm that this change aligns with the intended use cases, especially if lazy evaluation is expected in some scenarios.
| Sequence[TypeInfo[T]]

Comment thread injection/__init__.pyi
Comment thread injection/__init__.pyi
@remimd remimd merged commit bce9bb1 into dev Jun 14, 2025
5 checks passed
@remimd remimd deleted the hints branch June 14, 2025 11:26
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