[Python-ideas] relaxing keyword usage restrictions
mwm at mired.org
Fri Sep 9 20:50:14 CEST 2011
On Thu, Sep 8, 2011 at 11:04 PM, H Krishnan <hetchkay at gmail.com> wrote:
> Syntax is something people will get used to. The following is perfectly
> valid 'scheme' code:
> (define define 3)
> (* define 5)
> In my 10+ years in scheme, I have never used 'define' as a symbol, nor have
> I seen anyone else do it, even though there is no language restriction.
> 'self' is not a keyword in python, but I have not so far seen anyone use
> 'self' other than as the first argument of a class method.
Others have pointed out the parsing problems this would create. I'll point
out that Python is not Scheme. I'm a fan of both languages, but they are not
Scheme has a history of valuing power, and adding it by removing
restrictions. The example above - of allowing people to redefine what are
primitives in other languages - fits that model perfectly.
Python, on the other hand, has a history of valuing readability. With very
few exceptions, changes to Python make some use case more readable, without
adding a way to write really unreadable code. The change to have
non-reserved keywords clashes badly with that model.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas