Changed source.__next__() type hint

This commit is contained in:
GeoffreyCoulaud
2023-05-20 19:57:40 +02:00
parent 604bcfb2e9
commit 4bc35383ae

View File

@@ -1,5 +1,6 @@
from abc import abstractmethod from abc import abstractmethod
from collections.abc import Iterable, Iterator, Sized from collections.abc import Iterable, Iterator, Sized
from typing import Optional
from src.game import Game from src.game import Game
from src.window import CartridgesWindow from src.window import CartridgesWindow
@@ -22,7 +23,7 @@ class SourceIterator(Iterator, Sized):
"""Get a rough estimate of the number of games produced by the source""" """Get a rough estimate of the number of games produced by the source"""
@abstractmethod @abstractmethod
def __next__(self) -> "Game" | None: def __next__(self) -> Optional[Game]:
"""Get the next generated game from the source. """Get the next generated game from the source.
Raises StopIteration when exhausted. Raises StopIteration when exhausted.
May raise any other exception signifying an error on this specific game. May raise any other exception signifying an error on this specific game.