def new_iterator() -> Iterator:
    return Iterator()  # shouldn't compile
Exemple #2
0
def list_iterator(x: int) -> Iterator:
    return Iterator(x)
Exemple #3
0
def has_next(x: Collection) -> bool:
    return Iterator(x).next()
def dict_iterator(x: Dict[Any, Any]) -> Iterator:
    return Iterator(x)
def concat_iterators(x: List[str], y: Dict[int, bool]) -> Iterator:
    it1 = Iterator(x)
    it2 = Iterator(y)

    return it1.concat(it2)
Exemple #6
0
def concat_iterators(x: list, y: dict) -> Iterator:
    it1 = Iterator(x)
    it2 = Iterator(y)

    return it1.concat(it2)
def dict_iterator(x: Dict[Any, int]) -> str:
    it = Iterator(x)
    it.next()
    return it.value
Exemple #8
0
def concat_iterators(x: list) -> Iterator:
    it1 = Iterator(x)

    return it1.concat(42)
Exemple #9
0
def list_iterator(x: List[Any]) -> Iterator:
    return Iterator(x)