mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-10 07:15:50 +08:00
Make dataclasses.Field.metadata non-optional (#3094)
If `metadata` is `None` the Field constructor replaces it with an empty mapping object, so this value can never be None. https://github.com/python/cpython/blob/v3.7.3/Lib/dataclasses.py#L243
This commit is contained in:
1 parent
5dc89fe8cf
commit
3272307933
2 files changed
+2
-2
No files matched your search
Vendored
+1
-1
@@ -34,7 +34,7 @@ class Field(Generic[_T]):
|
||||
hash: Optional[bool]
|
||||
init: bool
|
||||
compare: bool
|
||||
metadata: Optional[Mapping[str, Any]]
|
||||
metadata: Mapping[str, Any]
|
||||
|
||||
|
||||
# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers
|
||||
|
||||
Reference in new issue
Block a user