r/Python • • Jun 06 '21

News PEP 661 -- Sentinel Values

https://www.python.org/dev/peps/pep-0661/
220 Upvotes

109 comments sorted by

View all comments

Show parent comment

3

u/genericlemon24 Jun 06 '21

As u/energybased already mentioned, None doesn't always work as a sentinel.

For example, when None is a valid value itself – how do you distinguish None-as-sentinel from None-as-value? This isn't necessarily common in user code, but happens quite a lot in libraries (when you want to allow the user to use None); I talk more about this in a comment below.