File tree 1 file changed +17
-10
lines changed
1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -531,17 +531,24 @@ def convert_to_list_like(
531
531
def temp_setattr (
532
532
obj , attr : str , value , condition : bool = True
533
533
) -> 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.
542
536
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.
545
552
"""
546
553
if condition :
547
554
old_value = getattr (obj , attr )
You can’t perform that action at this time.
0 commit comments