#mypy #python

Teacher:
Let's look at this code:
`comment: str = None`
Is the type correct?
mypy:
Yes, everything is just fine!

Follow

@alexcleac
Shouldn't that require Optional[str], or throw an error?

@gappleto97 mypy should throw an error probably. And yes, that should be marked as optional :)

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!