Very useful post I think. Not to depreciate Python the language, but it might be interesting to compare "adding a new statement to Python" with "adding a new statement to Lisp". Especially for people struggling to grasp Lisp's benefits.
my mind was immediately blown away by the following passage right at the top of system.fth, the part of pForth implemented in Forth on top of the C interpreter:
: ( 41 word drop ; immediate
( That was the definition for the comment word. )
( Now we can add comments to what we are doing! )
According to that question's answer and comments, that definition is buggy (making it not quite a fair comparison). Here is a less buggy, more flexible version, taken from a comment:
(defmacro unless [expr & body] `(if ~expr nil (do ~@body)))
I was reminded of this by the post on the goto statement -- having used the AST module recently in a limited capacity[1], I was really impressed by how easy it was to use. There's a good pycon talk for those interested specifically in this part of the process[2], and you can also see the full grammar[3].
This article doesn’t attempt to suggest the addition of an until statement to Python. Although I think such a statement would make some code clearer, and this article displays how easy it is to add, I completely respect Python’s philosophy of minimalism. All I’m trying to do here, really, is gain some insight into the inner workings of Python.