-
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Apr 15, 2022
Replies: 1 comment 3 replies
-
|
If you have the ability to change the interface to this function (e.g. refactor it into two calls), that's what I'd recommend. This sort of polymorphism will not work well with static typing. If you're stuck with the existing interface definition, then this is probably the best approach: @overload
def one(self, *names: str) -> Iterator[Tuple[Resource, ...]]: ... |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Kache
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

If you have the ability to change the interface to this function (e.g. refactor it into two calls), that's what I'd recommend. This sort of polymorphism will not work well with static typing.
If you're stuck with the existing interface definition, then this is probably the best approach: