-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Description:
A temporary fix has been applied to use from future import annotations to resolve an import and typing issue affecting the function resolve_one_of.
Context:
In the function:
We encountered issues with the typing module, particularly with aliases like SupportsKeysAndGetItem, which appear to behave inconsistently or are potentially deprecated in some Python versions.
Related documentation:
🔗 https://docs.python.org/3/library/typing.html#deprecated-aliases
Problem:
Python’s typing module has deprecated or altered behavior for certain constructs.
This affects the return type annotation and possibly others that rely on complex generic types.
The fix using future.annotations is temporary and avoids immediate runtime or type-checking issues, but isn't a long-term solution.
Next Steps:
Audit the use of typing across the project for deprecated or unstable patterns.
Ensure that returned dictionary-like structures have a clean, sustainable, and type-safe definition.
Evaluate whether custom Protocols or TypedDict should be used instead of generic built-ins like SupportsKeysAndGetItem.
Replace temporary imports once a long-term design is adopted.