File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,7 +172,10 @@ class FrozenInstanceError(AttributeError): pass
172172# A sentinel object for default values to signal that a default
173173# factory will be used. This is given a nice repr() which will appear
174174# in the function signature of dataclasses' constructors.
175- _HAS_DEFAULT_FACTORY = sentinel ('<factory>' )
175+ class _HAS_DEFAULT_FACTORY_CLASS :
176+ def __repr__ (self ):
177+ return '<factory>'
178+ _HAS_DEFAULT_FACTORY = _HAS_DEFAULT_FACTORY_CLASS ()
176179
177180# A sentinel object to detect if a parameter is supplied or not.
178181MISSING = sentinel ("MISSING" )
Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ def extract_tb(tb, limit=None):
136136 "another exception occurred:\n \n " )
137137
138138
139- _sentinel = sentinel ("<implicit>" )
139+ class _Sentinel :
140+ def __repr__ (self ):
141+ return "<implicit>"
142+
143+ _sentinel = _Sentinel ()
140144
141145def _parse_value_tb (exc , value , tb ):
142146 if (value is _sentinel ) != (tb is _sentinel ):
You can’t perform that action at this time.
0 commit comments