On Sun, 24 Feb 2013 17:40:54 -0500, Mitya Sirenef wrote: > But if block doesn't have to be inside a function, right? It needs to be > inside a module, but then again everything is inside a module, but it > wouldn't be very object-oriented if the module was the only object in > Python :-).
Python doesn't have code blocks as distinct values. I suppose you could fake it using compile() and eval() by hand, but it wouldn't work very well. Ruby-style code blocks have been requested for many years. GvR has given his support to this *in principle*, but it depends on somebody thinking up decent, unambiguous syntax that works with the rest of Python. -- Steven -- http://mail.python.org/mailman/listinfo/python-list