back
1 comments
> 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).

None was already a keyword; True and False were made keywords so that the names wouldn't be reassigned, and so that the bytecode could hard-code the values rather than a name lookup. GvR wrote more about it: https://python-history.blogspot.com/2013/11/ But the change didn't get much explanation in "what's new in 3.0".

> again, i'm curious about the rationale here. why is it that these aren't special, but the other constants are?

As further analysis shows, `...` is the real "constant" (with a dedicated syntax token and everything) and `Ellipsis` is just a pre-defined alias for it.

The observations about `__debug__` are strange, though. And I would agree that it would have been better to give `NotImplemented` the same treatment as `True` and `False` and `None`, since otherwise you can potentially interfere with user-defined cooperative operator overloads.