| Total Complexity | 5 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| 1 | """ |
||
| 23 | @object.__new__ # bind a single instance to the name 'Sentinel' |
||
| 24 | class Sentinel(object): |
||
| 25 | __doc__ = doc |
||
| 26 | __slots__ = ('__weakref__',) |
||
| 27 | __name__ = name |
||
| 28 | |||
| 29 | def __new__(cls): |
||
| 30 | raise TypeError("Can't construct new instances of %r" % name) |
||
| 31 | |||
| 32 | def __repr__(self): |
||
| 33 | return 'sentinel(%r)' % name |
||
| 34 | |||
| 35 | def __reduce__(self): |
||
| 36 | return sentinel, (name, doc) |
||
| 37 | |||
| 38 | def __deepcopy__(self, _memo): |
||
| 39 | return self |
||
| 40 | |||
| 41 | def __copy__(self): |
||
| 42 | return self |
||
| 43 | |||
| 55 |