One-liner blocks (was Re: accessing a functions var from a subfunction.)
Alex Martelli
aleax at aleax.it
Wed Apr 16 16:39:40 EDT 2003
Aahz wrote:
> 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.
Forcing linebreak after each & every colon? Oh well -- he's probably
getting bribes from large-screen and vertical-aspect-ratio monitor
manufacturers, is my guess...;-)
Alex
More information about the Python-list
mailing list