My mind is gone.
Today I decided to finally start teaching myself Python. Out of curiosity, I tried the following:
Code (python)
-
-
>>> class NoneType:
-
… def __str__(self):
-
… return ""
-
…
-
>>> None
-
>>> str(None)
-
‘None’
-
Is it sick that I find these results disappointing? Has Ruby corrupted my mind?
A few years ago I would have never even thought about overriding methods of a language’s null type.
1 Comment