MCPcopy Index your code
hub / github.com/python/cpython / __repr__

Method __repr__

Lib/multiprocessing/synchronize.py:203–218  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
202
203 def __repr__(self):
204 try:
205 if self._semlock._is_mine():
206 name = process.current_process().name
207 if threading.current_thread().name != 'MainThread':
208 name += '|' + threading.current_thread().name
209 count = self._semlock._count()
210 elif not self._semlock._is_zero():
211 name, count = 'None', 0
212 elif self._semlock._count() > 0:
213 name, count = 'SomeOtherThread', 'nonzero'
214 else:
215 name, count = 'SomeOtherProcess', 'nonzero'
216 except Exception:
217 name, count = 'unknown', 'unknown'
218 return '<%s(%s, %s)>' % (self.__class__.__name__, name, count)
219
220#
221# Condition variable

Callers

nothing calls this directly

Calls 1

_countMethod · 0.80

Tested by

no test coverage detected