New submission from Robin:

reproduction script below. In the last print statement, it shows me a list with 
items in it, but with a length of 0

def generator():
        l = []
        yield l
        l.append(1)
        # this correctly prints 1
        print(len(l))

# this should print [([1], 1)], but actually gives [([1], 0)]
print([(l, len(l)) for l in generator()])

----------
components: Interpreter Core
messages: 272151
nosy: robinh
priority: normal
severity: normal
status: open
title: List reports incorrect length if modifed after yield
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27707>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to