diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 7de9d006..abb0fbe8 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -1,5 +1,5 @@ from __future__ import annotations -from typing import Sequence, Union, TYPE_CHECKING +from typing import Sequence, Union, TYPE_CHECKING, NoReturn if TYPE_CHECKING: from .column_object import Column @@ -418,6 +418,18 @@ def __divmod__(self, other: DataFrame | Scalar) -> tuple[DataFrame, DataFrame]: """ ... + def __iter__(self) -> NoReturn: + """ + Iterate over elements. + + This is intentionally "poisoned" to discourage inefficient code patterns. + + Raises + ------ + NotImplementedError + """ + raise NotImplementedError("'__iter__' is intentionally not implemented.") + def any(self, skipna: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame.