mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)
This commit is contained in:
parent
a31f4cc881
commit
b01786c881
3 changed files with 15 additions and 3 deletions
|
@ -241,7 +241,7 @@ class Field:
|
|||
self.hash = hash
|
||||
self.compare = compare
|
||||
self.metadata = (_EMPTY_METADATA
|
||||
if metadata is None or len(metadata) == 0 else
|
||||
if metadata is None else
|
||||
types.MappingProxyType(metadata))
|
||||
self._field_type = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue