We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f248baf commit be7a67cCopy full SHA for be7a67c
2 files changed
25-class-metaprog/sentinel/sentinel.py
@@ -2,12 +2,12 @@
2
3
>>> class Missing(Sentinel): pass
4
>>> Missing
5
- <Missing>
+ Missing
6
>>> class CustomRepr(Sentinel):
7
- ... repr = '*** sentinel ***'
+ ... repr = '<CustomRepr>'
8
...
9
>>> CustomRepr
10
- *** sentinel ***
+ <CustomRepr>
11
12
"""
13
@@ -16,9 +16,8 @@ def __repr__(cls):
16
try:
17
return cls.repr
18
except AttributeError:
19
- return f'<{cls.__name__}>'
+ return cls.__name__
20
21
class Sentinel(metaclass=SentinelMeta):
22
def __new__(cls):
23
return cls
24
-
25-class-metaprog/sentinel/sentinel_test.py
@@ -8,7 +8,7 @@ class SentinelCustomRepr(Sentinel):
def test_repr():
- assert repr(PlainSentinel) == '<PlainSentinel>'
+ assert repr(PlainSentinel) == 'PlainSentinel'
14
def test_pickle():
0 commit comments