Type hinting a class that wraps function with __call__
method that conditionally modifies returned type
#1933
Unanswered
soneill-pure
asked this question in
Q&A
Replies: 1 comment
-
You could try using overloads on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to type hint a class that essentially wraps a function and adds some additional method(s). The original function can return any one of the
InitialOutputFrame
types, while the class wrapping the function will have a__call__
method that outputs a subset of those types according to a type mapping (type_mapping
). Anyone have any ideas how type hint this properly? If it seems like I'm doing something noobish it's probably because I am.Beta Was this translation helpful? Give feedback.
All reactions