You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because it does feel like T = TypeVar(int, float); TypeVar(T).is_subtype_of(int) should return True, or that T = TypeVar(bound=Union[int, float]); TypeVar(T).is_union should return True.
Following from that, it feels like either TypeView should either transparently be doing something equivalent to the following:
Summary
Given this line https://github.com/litestar-org/type-lens/blob/main/type_lens/type_view.py#L227 I think that could/should be rephrased as
if isinstance(self.annotation, typ): return TypeView(Union[bytes, str]).is_subtype_of(typ)
. And that seems interesting.Because it does feel like
T = TypeVar(int, float); TypeVar(T).is_subtype_of(int)
should return True, or thatT = TypeVar(bound=Union[int, float]); TypeVar(T).is_union
should return True.Following from that, it feels like either
TypeView
should either transparently be doing something equivalent to the following:or it should have a method like
resolve_type_var
which does this recursively (because e.g.list[T]
) or something...I suppose the contravariant/covariant kwargs for constraints are a meaningful consideration potentially...but i dunno...
Basic Example
No response
Drawbacks and Impact
No response
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: