summaryrefslogtreecommitdiffstats
path: root/Lib/dataclasses.py
diff options
context:
space:
mode:
authorChristopher Hunt <chrahunt@gmail.com>2019-02-12 11:50:49 (GMT)
committerEric V. Smith <ericvsmith@users.noreply.github.com>2019-02-12 11:50:49 (GMT)
commitb01786c8812c4cc24dd561b5941025bdd6f444c0 (patch)
tree7ce684adbbc729ae848b7190a87631ed9d92ef14 /Lib/dataclasses.py
parenta31f4cc881992e84d351957bd9ac1a92f882fa39 (diff)
downloadcpython-b01786c8812c4cc24dd561b5941025bdd6f444c0.zip
cpython-b01786c8812c4cc24dd561b5941025bdd6f444c0.tar.gz
cpython-b01786c8812c4cc24dd561b5941025bdd6f444c0.tar.bz2
bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)
Diffstat (limited to 'Lib/dataclasses.py')
-rw-r--r--Lib/dataclasses.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py
index 71d9896..325b822 100644
--- a/Lib/dataclasses.py
+++ b/Lib/dataclasses.py
@@ -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