diff --git a/ci/code_checks.sh b/ci/code_checks.sh index b65dcedbd8a10..88075e5e42880 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -107,7 +107,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_dict_like PR07,SA01" \ -i "pandas.api.types.is_file_like PR07,SA01" \ -i "pandas.api.types.is_float PR01,SA01" \ -i "pandas.api.types.is_hashable PR01,RT03,SA01" \ diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index f042911b53d2b..ebd87d5c426ce 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -273,14 +273,24 @@ def is_dict_like(obj: object) -> bool: """ Check if the object is dict-like. + This function checks if the input object has dictionary-like behavior, + specifically if it implements methods like ``__getitem__``, ``keys``, and + ``__contains__``. + Parameters ---------- - obj : The object to check + obj : object + The object to check for dict-like behavior. Returns ------- bool - Whether `obj` has dict-like properties. + Whether ``obj`` has dict-like properties. + + See Also + -------- + api.types.is_list_like : Check if the object is list-like. + api.types.is_scalar : Return True if given object is scalar. Examples --------