OptionalType10.1 Python *args와 **kwargs에 대한 타입 주석, Type annotations for *args and **kwargs 질문 I'm trying out Python's type annotations with abstract base classes to write some interfaces. Is there a way to annotate the possible types of *args and **kwargs? For example, how would one express that the sensible arguments to a function are either an int or two ints? type(args) gives Tuple so my guess was to annotate the type as Union[Tuple[int, int], Tuple[int]], but this doesn't work. fr.. 2023. 10. 30. 이전 1 다음