File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,9 +166,14 @@ class _MISSING_TYPE:
166166_EMPTY_METADATA = types .MappingProxyType ({})
167167
168168# Markers for the various kinds of fields and pseudo-fields.
169- _FIELD = object () # An actual field.
170- _FIELD_CLASSVAR = object () # Not a field, but a ClassVar.
171- _FIELD_INITVAR = object () # Not a field, but an InitVar.
169+ class _FIELD_BASE :
170+ def __init__ (self , name ):
171+ self .name = name
172+ def __repr__ (self ):
173+ return self .name
174+ _FIELD = _FIELD_BASE ('_FIELD' )
175+ _FIELD_CLASSVAR = _FIELD_BASE ('_FIELD_CLASSVAR' )
176+ _FIELD_INITVAR = _FIELD_BASE ('_FIELD_INITVAR' )
172177
173178# The name of an attribute on the class where we store the Field
174179# objects. Also used to check if a class is a Data Class.
@@ -237,7 +242,8 @@ def __repr__(self):
237242 f'repr={ self .repr !r} ,'
238243 f'hash={ self .hash !r} ,'
239244 f'compare={ self .compare !r} ,'
240- f'metadata={ self .metadata !r} '
245+ f'metadata={ self .metadata !r} ,'
246+ f'_field_type={ self ._field_type } '
241247 ')' )
242248
243249 # This is used to support the PEP 487 __set_name__ protocol in the
You can’t perform that action at this time.
0 commit comments