7

Python be like:
TypeError: 'callable_iterator' object is not callable
and also:
TypeError 'callable_iterator' object is not subscriptable

Why the fuck did you name it "callable iterator" if you can't call it, or iterate it.

Comments
  • 1
    It's not an array, It's an iterator, iterable doesn't mean subscriptable at all. For example a linked list is iterable but not subscriptable by default unless someone writes an honestly ugly hack around it.

    Not sure about the callable part honestly.
  • 3
    An iterator isn't iterable; A toaster isn't toastable, bread is toastable. A washing machine happens to be washable, but washing the washing machine means something completely different from using it to wash clothes.
  • 0
    Subscriptable implies that you can retrieve the n-th element without modifying the object. The iterator interface supports neither n-th element since it has no concept of a start or position, nor seeking.
  • 0
    An iterator could represent something like a blocking stream of console input, which you obviously can't subscript.
Add Comment