PYTHON PROGRAMMING
Python Types: Optional Can Mean Mandatory
Learn how to avoid a frequent misuse and misunderstanding of typing.Optional.
Published in
8 min readNov 21, 2023
According to the Python documentation, typing.Optional
is a handy way to indicate that an object can be None
. It’s a concise and elegant way to express this concept, but is it also crystal clear?