r/PythonLearning • u/ETL_Pipeline_Dev • 1d ago
Discussion Where do you use None in python
So far I've only really used None in two places:
- With dict.get(), when the key isn't there.
- With del in classes. I set a variable to None so the object gets cleaned up.
Where else do you use it? Do you use it as a default value for function arguments, or for missing data?
I'm curious how people use it in real projects.
14
Upvotes
View all comments
Show parent comment
1
u/Money_Ad_5277 23h ago
Shouldn't handling it with "if" be cheaper computation/memory-wise?
We all have different opinions and maybe it's related to different examples we use to prove our point of view