Python and Braces

Don’t like the fact that there is no braces in Python? Fancy to have curly brackets around your code blocks? Well, not a chance.

$ python
Python 2.4.3 (#1, Jul 22 2006, 23:54:13)
[GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import braces
 File "<stdin>", line 1
SyntaxError: not a chance

Apparently, according to SVN commit logs, that Jeremy Hylton committed that change back in February 2001, for the reason “Improve SyntaxErrors for bad future statements” :)

Category: General | Fri, 1 September 2006 11:30 am
Tags:

Comments

1.
Avatar for Medi
Posted by Medi on Tue, 7 July 2009 5:55 pm

I think logical statements should be independent of its physical layout. That is one should be able to
1- one logical statement on one physical line
2- Multiple logical statement on one physical line
3- One logical statement on several physical lines

Indentation has a block boundary is too week, don’t use readability as an excuse. Editors and personal preferences in expanding tabs will \n vs \r\n vs \r will create too many issues.

And finally, computer science should be converging by now. We are still arguing over syntax of languages. while C has established itself as the defacto (so far as the syntax is concern), then some language comes along and puts a spin into the whole mindset. What we need is a revolution like SQL. All languages converging on a similar syntax


Add a comment

Gravatar is used. Email address is required but will not be displayed. Please keep your comment on topic. No spamming and/or bad language. First time poster will be moderated. Scott reserves the right to delete/edit your comments.