Skip to content

Commit b1419fd

Browse files
committed
inline part 2
1 parent eef9041 commit b1419fd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/dataclasses.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ def __repr__(self):
207207
# The name of an attribute on the class where we store the Field
208208
# objects. Also used to check if a class is a Data Class.
209209
_FIELDS = '__dataclass_fields__'
210-
# The name of an attribute on the class where we store the field names.
211-
_FIELD_NAMES = '__dataclass_field_names__'
212210

213211
# The name of an attribute on the class that stores the parameters to
214212
# @dataclass.
@@ -1055,8 +1053,8 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
10551053
# also marks this class as being a dataclass.
10561054
setattr(cls, _FIELDS, fields)
10571055
# Store field names. Excludes pseudo-fields.
1058-
setattr(cls, _FIELD_NAMES, tuple(f.name for f in fields.values()
1059-
if f._field_type is _FIELD))
1056+
cls.__dataclass_field_names__ = tuple(f.name for f in fields.values()
1057+
if f._field_type is _FIELD)
10601058

10611059
# Was this class defined with an explicit __hash__? Note that if
10621060
# __eq__ is defined in this class, then python will automatically

0 commit comments

Comments
 (0)