[Python-ideas] relaxing keyword usage restrictions

Antoine Pitrou solipsis at pitrou.net
Tue Sep 6 18:35:51 CEST 2011


On Tue, 06 Sep 2011 09:51:36 -0700
Ethan Furman <ethan at stoneleaf.us> wrote:
> H Krishnan wrote:
> > Hi,
> > 
> > Apologies if this has been asked already: why can't the usage of at
> > least some keywords as identifiers be allowed with the context of the
> > usage being used to identify if a keyword or a variable is being
> > referred to.
> > 
> > For example,
> > 
> > if = 3  # if is identifier
> > if if = 3: # first if is keyword, second if is identifer
> 
> 
> Awkward, confusing, horrible.

We really need an enum class.

Antoine.





More information about the Python-ideas mailing list