Skip to content
Discussion options

You must be logged in to vote

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, ...]]: ...

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@erictraut
Comment options

@Kache
Comment options

@Kache
Comment options

Answer selected by Kache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants