alternatives to making blocks like { } or other ??

Roy Smith roy at panix.com
Thu May 20 10:52:58 EDT 2004


asmirnov1234567890 at yahoo.com (Andrei Smirnov) wrote:

> i do really suffer. i have to use Perl and i know that i have no chance 
> to convince my new boss (very smart guy) to switch to Python because of
> braces. that means wasted time on debugging perl crap code and listening
> about Perl 6 future might.
> 
> Please, Python writers, do provide braces as compatibility mode. 

Asking for braces in Python is like trying to teach a pig to sing; it 
won't work and it annoys the pig.

For better or worse, Python uses indentation for statement grouping.  
There are more or less three ways to deal with this:

1) Decide you like the idea and use the language.

2) Decide you don't like the idea, but find enough else worthwhile in 
the language that you get past your dislike of indentation and use the 
language anyway.

3) Decide the indentation issue is so onerous to you that you can't get 
past it and don't use the language.

Any of those are valid.  Personally, I fall into camp #2, and think 
people in camp #3 are being obstinate fools, but any of the above is 
preferable to trying to get the language maintainers to add braces to 
the language.  It just ain't going to happen.

On the other hand, anybody is free to download the source code to the 
system and modify it in any way they see fit.  If people like it, 
they'll adopt it.  Lots of people have come up with variants, add-ons, 
or outgrowths of the core language: Jython, NumPy, Prothon, Pyrex, 
Psyco, Parrot, etc.  Just in the last few days has yet another one 
called Pythong been mentioned, although details are still a bit sketchy 
on that :-)



More information about the Python-list mailing list