You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ArrayIterator is missing the __iter__ method, causing an exception when called (see below). I ran a simple example and verified that iterators need that method. Not sure how the tests are passing though.
[E 2024-12-05 19:14:27.909 ServerApp] Error saving file: Untitled.ipynb
TypeError("'ArrayIterator' object is not iterable")
Traceback (most recent call last):
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/jupyter_server_ydoc/rooms.py", line 285, in _maybe_save_document
"content": self._document.source,
^^^^^^^^^^^^^^^^^^^^^
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/jupyter_ydoc/ybasedoc.py", line 90, in source
return self.get()
~~~~~~~~^^
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/jupyter_ydoc/ynotebook.py", line 204, in get
cell = self.get_cell(i)
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/jupyter_ydoc/ynotebook.py", line 106, in get_cell
cell = self._ycells[index].to_py()
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/pycrdt/_map.py", line 111, in to_py
py[key] = val.to_py()
~~~~~~~~~^^
File "/Users/brgrange/Notebooks/bug398/.pixi/envs/default/lib/python3.13/site-packages/pycrdt/_array.py", line 350, in to_py
py = [value for value in self]
^^^^
TypeError: 'ArrayIterator' object is not iterable
The text was updated successfully, but these errors were encountered:
I always get confused about this myself. The Array is the iterable, and the ArrayIterator is the iterator. Both of those classes need an __iter__ method. I found this to be a nice explanation. It looks like you can have an iterator without this method, but that some usage cases like for loops require it.
The
ArrayIterator
is missing the__iter__
method, causing an exception when called (see below). I ran a simple example and verified that iterators need that method. Not sure how the tests are passing though.The text was updated successfully, but these errors were encountered: