Skip to content

Commit 92f46fc

Browse files
authored
DOC: Convert docstring to numpydoc. (#54617)
1 parent 67b19eb commit 92f46fc

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

pandas/core/common.py

+17-10
Original file line numberDiff line numberDiff line change
@@ -531,17 +531,24 @@ def convert_to_list_like(
531531
def temp_setattr(
532532
obj, attr: str, value, condition: bool = True
533533
) -> Generator[None, None, None]:
534-
"""Temporarily set attribute on an object.
535-
536-
Args:
537-
obj: Object whose attribute will be modified.
538-
attr: Attribute to modify.
539-
value: Value to temporarily set attribute to.
540-
condition: Whether to set the attribute. Provided in order to not have to
541-
conditionally use this context manager.
534+
"""
535+
Temporarily set attribute on an object.
542536
543-
Yields:
544-
obj with modified attribute.
537+
Parameters
538+
----------
539+
obj : object
540+
Object whose attribute will be modified.
541+
attr : str
542+
Attribute to modify.
543+
value : Any
544+
Value to temporarily set attribute to.
545+
condition : bool, default True
546+
Whether to set the attribute. Provided in order to not have to
547+
conditionally use this context manager.
548+
549+
Yields
550+
------
551+
object : obj with modified attribute.
545552
"""
546553
if condition:
547554
old_value = getattr(obj, attr)

0 commit comments

Comments
 (0)