bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)

This commit is contained in:
Christopher Hunt 2019-02-12 06:50:49 -05:00 committed by Eric V. Smith
parent a31f4cc881
commit b01786c881
3 changed files with 15 additions and 3 deletions

View file

@ -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