2026-08-01 python has 6 pre-declared “constants”: True, False, None, __debug__, Ellipsis (or equivalently …), and NotImplemented. but they all behave slightly differently, for some reason. True, False, and None True, False, and None are keywords. they aren’t identifiers, they’re just straight up their own lexical tokens. which is really weird; nothing else is like this in python. usually stuff is resolved during regular name resolution, not in the lexer itself. an interesting side effect of this is that expressions like x.True raise a SyntaxError. i’m curious as to what the rationale was for this decision (if there was one). there’s some more interesting stuff with these constants, but i’ll get to it later, since it ties in with the…
python’s pre-declared constants are kinda weird
Advertisement