Python seems to be created to be a fast, minimal language for getting stuff done. While I love Python, one thing has never made sense to me. Why name a null entity None
rather than Null
or even null
? Save a character for free! Does anyone know why this road was taken in Python?
This is a philosophical question: you're asking "why?".
Nonetheless, here's one answer: Python strives to be legible even for people who do not understand the language. This line:
if foo is None:
Reads better than this one:
if (foo == null) {
In normal English grammar, "null" isn't a thing. It's an adjective, not a noun. "None" is a noun, which is how you use it in computer science.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With