
Nov. 29, 2021
9:44 a.m.
On Sun, Nov 28, 2021 at 10:35:34PM -0800, Christopher Barker wrote:
Of course, Python being Python, if in a given use case, you don’t need __iter__, you don’t have to have it.
[cynicism=on] If you think your iterator doesn't need `__iter__`, just wait, and you will find that it does. [cynicism=off] This is Python. We will defend your right to create a class that uses `__eq__` to delete files and `__add__` to multiply :-)
Just like the fact that you can pass anything with an appropriate read() method into json.load() will work, but that doesn’t make it a File.
Exactly. -- Steve