You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very common for functions to return a type or None. In typescript you can say string | null and the checker will warn you where you forgot to defend against potential null instances. How do you indicate that something may be a type or None ?
The text was updated successfully, but these errors were encountered:
arush
changed the title
How to indicate [this type] or [that type]
How to indicate [this type] or NoneMay 24, 2018
arush
changed the title
How to indicate [this type] or None
How to indicate [this type] or None
May 24, 2018
In Python, that would be Optional[str], that is a shorthand for Union[str, None].
You can find a full description of these type annotations, and more, at https://docs.python.org/3/library/typing.html
It is very common for functions to return a type or None. In typescript you can say
string | null
and the checker will warn you where you forgot to defend against potential null instances. How do you indicate that something may be a type orNone
?The text was updated successfully, but these errors were encountered: