collections.deque "TypeError: iter() returned non-iterator of type 'deque_iterator'"

22 views
Skip to first unread message

Asher Wolfstein

unread,
Jun 13, 2017, 6:06:01 PM6/13/17
to brython
When I run the following code with Brython:

import collections

d = collections.deque([1, 6, 2, 4])

if I try to run "d = list(d)" or any kind of list comprehension I get the following error:

"TypeError: iter() returned non-iterator of type 'deque_iterator'"

Any help?

Asher

Pierre Quentel

unread,
Jun 17, 2017, 10:30:20 AM6/17/17
to brython
Thanks for reporting this. Bug are usually reported on the Github issue tracker, but i's ok to report them here too.

The issue was due to module _collections.py, copied from PyPy for Python version 2.x, where iterators implement method next() instead of __next__().

It's fixed in the latest commit.
 

Asher Wolfstein

unread,
Jun 19, 2017, 11:36:26 PM6/19/17
to brython
I'm a little new to open source collaboration, so next time I'll try to go through the github issue tracker.  Thanks!

Asher
Reply all
Reply to author
Forward
0 new messages