Skip to content

poison __iter__ #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down