[Python-ideas] relaxing keyword usage restrictions

Jakob Bowyer jkbbwr at gmail.com
Mon Sep 5 17:16:35 CEST 2011


-1 to the concept. It seems to create readability issues?
I mean this sounds bad really

if if == 3:

On Mon, Sep 5, 2011 at 1:10 PM, Devin Jeanpierre <jeanpierreda at gmail.com>wrote:

> The "as" keyword used to be a pseudokeyword that functioned this way.
> Apparently the experiment didn't go well, as it was changed to a full
> keyword in 2.6.
>
> Devin
>
> On Mon, Sep 5, 2011 at 12:55 AM, H Krishnan <hetchkay at gmail.com> 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
> >
> > A more complex usage may require some rules:
> >
> > a = not or and and
> > ==> parse left to right to interpret as a = ( (not or) and (and) ).
> > 'or' and the last 'and' are identifiers
> >
> > While some of the usage may be confusing to the user, that is not for
> > the language to dictate but for the user to choose.
> >
> > Almost all keywords have specific semantics which (in my limited
> > understanding) do not conflict with their usage as identifiers.
> >
> > Regards,
> > Krishnan
> > _______________________________________________
> > Python-ideas mailing list
> > Python-ideas at python.org
> > http://mail.python.org/mailman/listinfo/python-ideas
> >
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110905/72cb2964/attachment.html>


More information about the Python-ideas mailing list