[Sincere apologies: My ideas was been reorganized by a LLM (and been revised by me), It will not go happen again. Breaked english, and Google Translator screws me more than help me]
Preliminary note
Please don’t argue that I should pick different names with similar meanings, add a trailing underscore, or claim that some names “don’t make sense” to be declared. That is subjective and cannot be stated with certainty. Those are just workarounds that avoid the actual problem being discussed.
Ambiguity as an argument against syntax proposals
A common argument against new syntax proposals is that they would be ambiguous and therefore go against Python’s principles.
The issue is that this argument already applies to Python itself: keyword-based syntax is not as uniform as it is often presented, and the language already relies on exceptions to deal with that.
The clearest example is the introduction of soft keywords — words that behave like keywords only in certain contexts, while remaining valid identifiers elsewhere.
Soft keywords acknowledge the problem
Soft keywords are not just an implementation detail. They exist because strict keywords break existing code and restrict the available namespace too much.
Examples that are valid in Python:
type Age = int # ok (soft keyword)
type = 'anything' # ok
match = 'anything' # ok
case = 'anything' # ok
_ = 'anything' # ok
These examples show that Python already accepts that the same word can act as a keyword in one place and as an identifier in another.
Inconsistency between soft and hard keywords
At the same time, many keywords are still completely forbidden as identifiers, even when the surrounding syntax makes their meaning obvious:
def pause(self): ... # ok
def continue(self): ... # SyntaxError
def break(self): ... # SyntaxError
def as(self, type): ... # SyntaxError
def with(self, obj): ... # SyntaxError
Another example:
importlib.import # SyntaxError
importlib.import_module # ok
In these cases, there is no real confusion for either the reader or the parser. After a dot (.) or inside a function definition, this is clearly an identifier, not a control-flow statement.
The restriction is global and syntactic, not contextual.
Statements, values, and keywords
Statements usually do not produce values, which partly explains why some of them can be treated as soft keywords. Still, most statements remain hard keywords, and the line between the two is not consistent.
This is not a technical limitation, but a design choice.
About literals: None, True, and False
I intentionally leave None, True, and False out of this discussion for a simple reason:
- They are core values of the language
- They must be immutable
- They behave like constants
Preventing reassignment of these names makes sense. However, that does not mean the same word should be forbidden as an identifier in every possible context.
The real issue is that Python does not try to distinguish whether a name refers to a language literal or a user-defined identifier. That points to a limitation in the grammar, not a conceptual requirement.
Why explicit prefixes help
This is where explicit prefixes used by other languages become relevant:
$continue # variable
continue # keyword
$True # variable
True # keyword
With this approach:
- There is no ambiguity
- Names do not need to be globally forbidden
- The programmer’s intent is visible at the lexical level
Python is not the only language that made this trade-off. Others made similar choices. The difference is that Python also claims to avoid ambiguity as a guiding principle.
Conclusion
Given Python’s own principles — especially “Explicit is better than implicit” and “In the face of ambiguity, refuse the temptation to guess” — the current model based on globally hard keywords deserves reconsideration.
Otherwise, it gives the impression that the language relies on restrictions instead of clear mechanisms, while still claiming to avoid ambiguity.
Maybe not in today’s Python — but perhaps in a future version.