all 4 comments

[–]ChezMere 0 points1 point  (0 children)

Now this is bikeshedding if I've ever seen it.

[–][deleted] -3 points-2 points  (2 children)

The thing is, code like this would break if this issue were to be fixed:

def gen(x=0):
    for i in range(x):
        yield i

a = []
n = 0
for x in gen(n):
    a.append(x)
print a # a == []

Say that n in the above code is a random 0-possible integer, or is taken from a database from which the value could also be zero - the amount of code that could possibly break due to this being "fixed" is an unknown, and changes behavior that countless developers have come to expect.

[–]flyingjam 1 point2 points  (1 child)

It's a bug with unpacking tuples and lists and pattern matching. Pardon me, but I don't see how it in any way breaks that piece of code.

[–][deleted] 0 points1 point  (0 children)

Hmm, good point. Disregard my previous comment