One-liner blocks (was Re: accessing a functions var from a subfunction.)

Aahz aahz at pythoncraft.com
Wed Apr 16 16:08:04 EDT 2003


In article <iCzma.16405$T34.518484 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
>
>def test():
>    class Bunch: pass
>    loc = Bunch()
>    loc.count = 0
>    def inc_count():
>        loc.count += 1
>    inc_count()
>    inc_count()
>    print loc.count

Note that Guido deeply regrets permitting one-line blocks; this is
something he may try fixing for Python 3.0.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?




More information about the Python-list mailing list