24 Apr
2018
24 Apr
'18
11:46 p.m.
On Tue, Apr 24, 2018 at 11:28 AM, Chris Angelico
On re-thinking this, I think the distinction IS possible, but (a) only in function/class scope, not at global; and (b) would be defined in terms of lexical position, not run-time. For instance:
def f(): (a = 1) # Legal; 'a' has not been used yet a = 2 # doesn't change that
def f(a): (a = 1) # Invalid - 'a' has been used already
def f(): while (a = get_next()): # Legal ...
Now *this* is a weird rule. Moving functions around files would become impossible. Please experiment with my reference implementation, it already implements my proposal in full. Loops and inline assignments work as expected in it. Yury