GEEK HAUS
Back to feed
2026/08/25/python-s-six-pre-declared-constants-behave

Python’s six pre-declared constants behave inconsistently across keywords, identifiers, assignment rules, and runtime optimization modes

·sebsite.pw
read original

EDITOR BRIEF

The article examines Python’s six pre-declared constants: True, False, None, debug, Ellipsis, and NotImplemented. It highlights how True, False, and None are keywords, while debug is a special identifier that cannot be assigned to and changes under optimized execution.

INSIGHTS

These quirks show how Python’s language design balances historical decisions, parser behavior, and runtime semantics in ways that are not always uniform. For developers and tooling authors, such edge cases matter because special-cased constants can affect syntax validation, static analysis, and expectations about name resolution.

COMMENTS

Discussion

> geekhaus:~$ next read?

Next read recommendations