Shane Hathaway <[EMAIL PROTECTED]> wrote: > > Nick Coghlan wrote: > > That would be good, in my opinion. I updated PEP 3XX to use this idea: > > http://members.iinet.net.au/~ncoghlan/public/pep-3XX.html > > > > With that update (to version 1.6), PEP 3XX is basically PEP 343, but > > injecting > > exceptions that occur into the template generator's internal frame instead > > of > > invoking next(). > > > > The rest of the PEP is then about dealing with the implications of allowing > > yield inside try/finally statements. > > You might add to the PEP the following example, which could really > improve the process of building GUIs in Python: > > class MyFrame(Frame): > def __init__(self): > with Panel(): > with VerticalBoxSizer(): > self.text = TextEntry() > self.ok = Button('Ok') > > Indentation improves the readability of code that creates a hierarchy.
I've generally been fairly ambiguous about the entire PEP 310/340/343 issue. While resource allocation and release is quite useful, not a whole heck of a lot of my code has to deal with it. But after seeing this sketch of an example for its use in GUI construction; I must have it! +1 for: - 'do' keyword (though 'try' being reused scratches the 'no new keyword' itch for me, and is explicit about "I won't loop") - PEP 343 - try/finally + @do_template with generators - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com