[Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

Alex Martelli aleaxit at gmail.com
Thu Jun 19 07:55:32 CEST 2008


On Wed, Jun 18, 2008 at 9:58 PM, Cesare Di Mauro <cesare at pronto.it> wrote:
> Very very, interesting. Thanks. :)
>
> Somebody thinks that Python is unsuitable to implement a DSL: IMO your example prove the contrary. :D

As long as you're willing to do the "DSL" within the strictures of
Python syntax, it's OK - not quite as flexible as LISP or Scheme or
even Ruby, but better than most;-).  I did design and implement "DSL"s
in Python (mostly specialized class trees with suitable metaclasses,
decorators &c) in many jobs in my recent past, I'll admit -- it never
feels as free-flowing as Scheme did back when I used THAT, but, close
enough to make my jobs successful!-)


Alex


More information about the Python-Dev mailing list