Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Upcoming Python features brought to you by Python Enhancement Proposals. Parent comment
It does. The old syntax creates and assigns the variable at compile-time. => does it at execution time.
So this code:
def foo(bar, baz=[]): baz.append(bar) return baz foo(1) foo(2) print(foo(3))
But this code:
def foo(bar, baz=>[]): baz.append(bar) return baz foo(1) foo(2) print(foo(3))
There are no comments on this comment yet.
It does. The old syntax creates and assigns the variable at compile-time. => does it at execution time.
So this code:
would print '[1, 2, 3]'But this code:
would print '[3]'