[Python-ideas] Re: Optimize out unused variables

2020-04-09 Thread Serhiy Storchaka
09.04.20 03:46, Henk-Jaap Wagenaar пише: I like the idea of formalizing "unused variables". How about having a syntax for it? Allowing a "." instead of an identifier to signify this behaviour [reusing Serhiy's examples]: head, ., rest = path.partition('/') first, second, *. = line.split()

[Python-ideas] Re: Optimize out unused variables

2020-04-09 Thread Serhiy Storchaka
09.04.20 00:54, Andrew Barnert via Python-ideas пише: Could you go so far as to remove the variable from the locals if its only assignment(s) are optimized out? I’m not sure how much benefit that would provide. (Surely it would sometimes mean an f_locals array fits into one cache line instead

[Python-ideas] Re: Optimize out unused variables

2020-04-08 Thread Henk-Jaap Wagenaar
I like the idea of formalizing "unused variables". How about having a syntax for it? Allowing a "." instead of an identifier to signify this behaviour [reusing Serhiy's examples]: head, ., rest = path.partition('/') first, second, *. = line.split() for . in range(10): ... [k for k, . in pairs]

[Python-ideas] Re: Optimize out unused variables

2020-04-08 Thread Andrew Barnert via Python-ideas
On Apr 8, 2020, at 10:59, Serhiy Storchaka wrote: > > I doubted whether or not to write, but since Guido has already touched a > similar topic (see "Live variable analysis -> earlier release"), so will I > write. > > It is common to assign some values which are never used to variables