Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • You probably want to subscript collections.abc.Iterator directly instead; see docs.python.org/3/library/typing.html#typing.Iterator. By the way, the minimum needed version to run this isn't 3.10 due to typing. Commented Mar 15, 2023 at 15:11
  • Thanks for your review. I was confused by the PEP 604 enabling Type | None in place of Optional[Type] But this does not apply here. So, you're right python 3.10 is not required. PEP 585 confirms your suggestion, so I've updated my answer. Commented Mar 15, 2023 at 16:15