Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
gh-88071: Update docstrings of dataclass' astuple and asdict (#101806)
Browse files Browse the repository at this point in the history
Update dataclasses.astuple and dataclasses.asdict docstrings to reflect that they deep copy objects in the field values.
  • Loading branch information
ischurov authored Mar 11, 2023
1 parent 7961f78 commit 111beac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ class C:
If given, 'dict_factory' will be used instead of built-in dict.
The function applies recursively to field values that are
dataclass instances. This will also look into built-in containers:
tuples, lists, and dicts.
tuples, lists, and dicts. Other objects are copied with 'copy.deepcopy()'.
"""
if not _is_dataclass_instance(obj):
raise TypeError("asdict() should be called on dataclass instances")
Expand Down Expand Up @@ -1353,7 +1353,7 @@ class C:
If given, 'tuple_factory' will be used instead of built-in tuple.
The function applies recursively to field values that are
dataclass instances. This will also look into built-in containers:
tuples, lists, and dicts.
tuples, lists, and dicts. Other objects are copied with 'copy.deepcopy()'.
"""

if not _is_dataclass_instance(obj):
Expand Down

0 comments on commit 111beac

Please sign in to comment.