Spaces:
Running
on
Zero
Running
on
Zero
# Copyright (c) Meta Platforms, Inc. and affiliates. | |
import abc | |
from typing import Any, Generator, Generic, TypeVar | |
T = TypeVar("T") | |
C = TypeVar("C") | |
class StatefulIterator(Generic[T, C], abc.ABC): | |
def get_state(self) -> C: | |
pass | |
def create_iter(self) -> Generator[T, Any, None]: | |
pass | |
class IteratorState(Generic[C]): | |
def build(self) -> StatefulIterator[T, C]: | |
pass | |