From 239c6eff073ca63503761e6147425eddc31d758e Mon Sep 17 00:00:00 2001 From: sunlight798 <3281498087@qq.com> Date: Wed, 30 Oct 2024 22:13:16 +0800 Subject: [PATCH] DOC: fix PR07,SA01 for pandas.api.types.is_iterator --- ci/code_checks.sh | 1 - pandas/_libs/lib.pyx | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index b727d93879a86..aa1fd2caba677 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -85,7 +85,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.resolution PR02" \ -i "pandas.Timestamp.tzinfo GL08" \ -i "pandas.Timestamp.year GL08" \ - -i "pandas.api.types.is_iterator PR07,SA01" \ -i "pandas.api.types.is_re_compilable PR07,SA01" \ -i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \ -i "pandas.arrays.ArrowExtensionArray PR07,SA01" \ diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index 8b6d73cda355b..de603beff7836 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -259,15 +259,23 @@ def is_iterator(obj: object) -> bool: Check if the object is an iterator. This is intended for generators, not list-like objects. + This method checks whether the passed object is an iterator. It + returns `True` if the object is an iterator, and `False` otherwise. Parameters ---------- obj : The object to check + The object to check for iterator type. Returns ------- is_iter : bool Whether `obj` is an iterator. + `True` if the object is of iterator type, otherwise `False`. + + See Also + -------- + api.types.is_list_like : Check if the input is list-like. Examples --------