Skip to content
Discussion options

You must be logged in to vote

object may have a meaning closer to what you're looking for:

def a(n: int) -> None: ...

def foo(b: object) -> None:
    a(b)  # E: Argument of type "object" cannot be assigned to parameter "n" of type "int" in function "a"

foo(1)   # ok
foo("")  # ok

For more on how object vs Any differ, you can refer to

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@pycaw
Comment options

Comment options

You must be logged in to vote
1 reply
@pycaw
Comment options

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