from typing import TYPE_CHECKING
if TYPE_CHECKING:
import annotated_types
class Dependency:
def __init__(self, db: Database, broken_hint: annotated_types.Any = 1):
self.broken_hint = broken_hint
injected = injector.inject(Dependency)()
raises Exception
NameError: name 'annotated_types' is not defined
magic_di.exceptions.InspectionError: Failed to inspect
See the exception above
Proposed solution:
Add fallback to inspect.signature or obj.__annotations__