MCPcopy Index your code
hub / github.com/RustPython/RustPython / __repr__

Method __repr__

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

Source from the content-addressed store, hash-verified

169 SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
170
171 def __repr__(self):
172 try:
173 if self._semlock._is_mine():
174 name = process.current_process().name
175 if threading.current_thread().name != 'MainThread':
176 name += '|' + threading.current_thread().name
177 elif not self._semlock._is_zero():
178 name = 'None'
179 elif self._semlock._count() > 0:
180 name = 'SomeOtherThread'
181 else:
182 name = 'SomeOtherProcess'
183 except Exception:
184 name = 'unknown'
185 return '<%s(owner=%s)>' % (self.__class__.__name__, name)
186
187#
188# Recursive lock

Callers

nothing calls this directly

Calls 3

_is_mineMethod · 0.80
_is_zeroMethod · 0.80
_countMethod · 0.45

Tested by

no test coverage detected