Sep 1 2006

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” :)

1 Comment

  1. Medi on 7 Jul 2009 at 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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>