File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
25-class-metaprog/sentinel Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 22
33 >>> class Missing(Sentinel): pass
44 >>> Missing
5- < Missing>
5+ Missing
66 >>> class CustomRepr(Sentinel):
7- ... repr = '*** sentinel *** '
7+ ... repr = '<CustomRepr> '
88 ...
99 >>> CustomRepr
10- *** sentinel ***
10+ <CustomRepr>
1111
1212"""
1313
@@ -16,9 +16,8 @@ def __repr__(cls):
1616 try :
1717 return cls .repr
1818 except AttributeError :
19- return f'< { cls .__name__ } >'
19+ return cls .__name__
2020
2121class Sentinel (metaclass = SentinelMeta ):
2222 def __new__ (cls ):
2323 return cls
24-
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class SentinelCustomRepr(Sentinel):
88
99
1010def test_repr ():
11- assert repr (PlainSentinel ) == '< PlainSentinel> '
11+ assert repr (PlainSentinel ) == 'PlainSentinel'
1212
1313
1414def test_pickle ():
You can’t perform that action at this time.
0 commit comments