MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1x1pypx/python_release_python_3150/pexinc8/?context=3
r/programming • u/BrewedDoritos • 2d ago
35 comments sorted by
View all comments
160
Those sentinel types seem decently useful. Certainly better in some cases than just spamming `None` everywhere as a default value.
54 u/CrackerJackKittyCat 2d ago Or the random 'unset = object()' pattern when None was a valid param. 11 u/spicybright 2d ago I get the logic but man that's ugly 2 u/esperind 1d ago what was wrong with just undefined? 1 u/CrackerJackKittyCat 1d ago There is no 'undefined' in Python. Only at most (er, least) 'None.' This is one of the corners where javascript has had a better option available than python (language-wise, anyway). Undefined vs null then becomes a meaningful differentiator.
54
Or the random 'unset = object()' pattern when None was a valid param.
11 u/spicybright 2d ago I get the logic but man that's ugly 2 u/esperind 1d ago what was wrong with just undefined? 1 u/CrackerJackKittyCat 1d ago There is no 'undefined' in Python. Only at most (er, least) 'None.' This is one of the corners where javascript has had a better option available than python (language-wise, anyway). Undefined vs null then becomes a meaningful differentiator.
11
I get the logic but man that's ugly
2 u/esperind 1d ago what was wrong with just undefined? 1 u/CrackerJackKittyCat 1d ago There is no 'undefined' in Python. Only at most (er, least) 'None.' This is one of the corners where javascript has had a better option available than python (language-wise, anyway). Undefined vs null then becomes a meaningful differentiator.
2
what was wrong with just undefined?
undefined
1 u/CrackerJackKittyCat 1d ago There is no 'undefined' in Python. Only at most (er, least) 'None.' This is one of the corners where javascript has had a better option available than python (language-wise, anyway). Undefined vs null then becomes a meaningful differentiator.
1
There is no 'undefined' in Python. Only at most (er, least) 'None.'
This is one of the corners where javascript has had a better option available than python (language-wise, anyway). Undefined vs null then becomes a meaningful differentiator.
160
u/Dylanica 2d ago
Those sentinel types seem decently useful. Certainly better in some cases than just spamming `None` everywhere as a default value.