Should I type something as Optional if None breaks the logic of the function, but I do check for ...

Subscribers:
4,130
Published on ● Video Link: https://www.youtube.com/watch?v=PXhxvOErW7c



Category:
Vlog
Duration: 3:23
4 views
0


Should I type something as Optional if None breaks the logic of the function, but I do check for it inside the body?
I hope you found a solution that worked for you :)
The Content (except music & images) is licensed under (https://meta.stackexchange.com/help/licensing)CC BY-SA |
Thanks to all those great people for their contributions!

(stackoverflow.com/users/2982614/sharkovsky87)Sharkovsky87 |
(stackoverflow.com/users/1126841/chepner)chepner |
(stackoverflow.com/users/19770795/daniil-fajnberg)Daniil Fajnberg |
A special thanks goes out to the (https://stackoverflow.com/questions/74825382/should-i-type-something-as-optional-if-none-breaks-the-logic-of-the-function-bu)Stackexchange community |

I wish you all a wonderful day! Stay safe :)

python python-typing type-hinting







Tags:
python
python-typing
type-hinting