Python slang

eryk sun eryksun at gmail.com
Sat Aug 6 02:44:37 EDT 2016


On Sat, Aug 6, 2016 at 2:10 AM, Chris Angelico <rosuav at gmail.com> wrote:
> That answers the question about True and False, but not about None,
> which started the question. Why are instances capitalized here? Is it
> simply a matter of grandfathering in, with no specific decision?

Using CamelCase for the single-instance (singleton) objects -- None,
NotImplemented, and Ellipsis -- highlights their special nature, i.e.
that we check for them by identity. "not_implemented" would look like
just another local variable.

I wish that NotImplemented had been made a keyword, just like None,
True, and False. I see no value in being able to assign to this name.
It invites confusion. For Ellipsis we at least have `...`.



More information about the Python-list mailing list