Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert _ATOMIC_TYPES to frozenset
  • Loading branch information
DavidCEllis committed Mar 24, 2023
commit 6280f2ed4949f77b9771f72287fd89a5cc67b938
4 changes: 2 additions & 2 deletions Lib/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __repr__(self):

# Atomic immutable types which don't require any recursive handling and for which deepcopy
# returns the same object. We can provide a fast-path for these types in asdict and astuple.
_ATOMIC_TYPES = {
_ATOMIC_TYPES = frozenset({
# Common JSON Serializable types
types.NoneType,
bool,
Expand All @@ -242,7 +242,7 @@ def __repr__(self):
type,
range,
property,
}
})

# This function's logic is copied from "recursive_repr" function in
# reprlib module to avoid dependency.
Expand Down