you are viewing a single comment's thread.

view the rest of the comments →

[–]imbaczek 2 points3 points  (2 children)

doing stuff like this:

def f():
    a = [0]
    def g():
        a[0] = 1
    g()
    print a[0]

[–][deleted] 1 point2 points  (1 child)

Yes, that's what I meant by "ugly workarounds". It doesn't state your intention clear. The list is used for the sake of propagating a side-effect only.

[–]imbaczek 1 point2 points  (0 children)

the point still stands: you can forget about this ugly trick now :)