Tested with "console_fr.html" / firefox 17.0.1 (linux):
print("A", doc.__class__, doc)
for i in doc:
print("A", "-", i)
def show(c, l):
print(c, l.__class__, l)
for i in l:
print(c, "-", i.__class__, i)
for i in doc:
show("B", i)
print("C", doc.__class__, doc)
show("C", doc)
print(doc.__class__, doc)
show("C", doc)
Output:
A undefined [object Object]
A - [object HTMLHtmlElement]
B undefined [object HTMLHtmlElement]
B - undefined [object HTMLHeadElement]
B - undefined [object Object]
B - undefined [object HTMLBodyElement]
C undefined [object Object]
C $DomWrapper [object Object]
and a console error after "C" case:
ExecutionError: ExecutionError: $iter2.__len__ is not a function
Line 7
for i in l: @ http://www.brython.info/py_utils.js:34
Case "C" shows that when parsing arguments "doc" get wrapped (by $MakeArgs ?)
and loses its iteration ability.
Original issue reported on code.google.com by pedro.ro...@gmail.com on 28 Dec 2012 at 11:54
Original issue reported on code.google.com by
pedro.ro...@gmail.com
on 28 Dec 2012 at 11:54