Luke Lee

Software Engineer

Web + Desktop + Science

Fork me on Github

Adding braces to Python

Ever wonder what it would take to add braces to Python? Enter Python with braces.

The main diff modifies the Python grammar and related parsing functionality. If you're still interested, the following little snippets kickstart the magic:

I don't think this will fork will catch on at all even though I'd consider myself the target audience for this type of thing. I'm a Python convert from a long history in C and wouldn't want to use this. I love the indentation requirement.

However, this project illustrates how open sourcing a language can open up all sorts of possibilities and allow smaller communities to form around their own preferences. Maybe this type of project opens Python up to all the people who would love the language if they could just get past the whitespace requirement.

Again, using a fork like this is probably not advisable for production, in my opinion, but you have to admit the diff is relatively small.

Finally, it's great that Python has a single grammar file and even a published guide to changing Python's grammar for people interested in syntax design and parsing.

Published: 03-09-2014 15:11:31

lukelee.net