Richard Jones: Something I'm working on... Python’s with statement appears to provide just enough syntactic sugar to create some really interesting DSL-style APIs—here’s a very promising example for laying out GUI applications.
Richard Jones: Something I'm working on... Python’s with statement appears to provide just enough syntactic sugar to create some really interesting DSL-style APIs—here’s a very promising example for laying out GUI applications.
Whereas my thoughts were almost the opposite: "here's a good example of why 'with' isn't a particularly good idea." Code of any significant length in that style is really hard to read at a glance. It removes the "does exactly what it looks like" aspect of Python.
Adding 'with' to the language was another one of those errors we'll be stuck with from now on. :(