TIL: How to type args and kwargs
Read OriginalThis article details the common mistake of typing *args as a tuple and **kwargs as a dict in Python. It explains that the correct approach is to type the values within these containers directly (e.g., *args: str, **kwargs: Any) for compatibility with type checkers, and credits Will McGugan for the explanation.
0 Comments
Comments
No comments yet
Be the first to share your thoughts!
Top of the Week
No top articles yet