[Python-ideas] Crazy idea: allow keywords as names in certain positions

Paul Moore p.f.moore at gmail.com
Tue May 15 06:36:29 EDT 2018


On 15 May 2018 at 11:07, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Tue, 15 May 2018 21:51:20 +1200
> Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Ethan Furman wrote:
>> > Part of the point of the proposal is to be able to use existing keywords
>> > (at least, I thought it was).
>>
>> Mainly it's so that *new* keywords can be added to the language
>> without breaking old code. Nobody is going to want to turn one
>> of the currently existing keywords into a name.
>
> I'm a worried that we're speaking about making it *easier* to add new
> keywords.  The language doesn't need a C++-like destiny, IMHO, where
> the language definition becomes increasingly bloated by piling up
> syntactical features.

Agreed - but there also seems to be a trend at the moment to propose
punctuation-based syntax, with keyword-based alternatives being
rejected on the basis that keywords break backward compatibility
(because of existing use as variables). I'm not sure a Perl-like
destiny (where we pile up extra punctuation) is that much better. I'm
not in favour of this idea (it seems likely there will be too many odd
corner cases and exceptions) but I can understand the motivation
behind it.

As you say, the real solution is of course to exercise restraint in
what new syntax gets added. But looking at the recent "what's new in
Python" docs, the reality is actually a lot more restrained than
reading python-ideas might imply - so I'm not sure things are as bad
as they initially seem.

Paul


More information about the Python-ideas mailing list