Friday, October 1, 2010

Braces in Python? No way.

In Python, whitespace is significant and used to delineate code blocks.  Many other languages use braces (or BEGIN and END or some other matched pair of tokens).  Will Python ever have braces?
cascade:~> python
Python 2.4.6 (#1, Dec 13 2009, 23:45:11) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance
>>> 
Take a close look.  Hilarious.

Hat-tip to PEP 3099, a fascinating laundry list of Python language design ideas deemed so bad they're non-starters.

Cheers,

Steve

No comments:

Post a Comment