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

Method __repr__

Lib/multiprocessing/process.py:266–293  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

264 raise ValueError("process not started") from None
265
266 def __repr__(self):
267 exitcode = None
268 if self is _current_process:
269 status = 'started'
270 elif self._closed:
271 status = 'closed'
272 elif self._parent_pid != os.getpid():
273 status = 'unknown'
274 elif self._popen is None:
275 status = 'initial'
276 else:
277 exitcode = self._popen.poll()
278 if exitcode is not None:
279 status = 'stopped'
280 else:
281 status = 'started'
282
283 info = [type(self).__name__, 'name=%r' % self._name]
284 if self._popen is not None:
285 info.append('pid=%s' % self._popen.pid)
286 info.append('parent=%s' % self._parent_pid)
287 info.append(status)
288 if exitcode is not None:
289 exitcode = _exitcode_to_name.get(exitcode, exitcode)
290 info.append('exitcode=%s' % exitcode)
291 if self.daemon:
292 info.append('daemon')
293 return '<%s>' % ' '.join(info)
294
295 ##
296

Callers

nothing calls this directly

Calls 4

pollMethod · 0.45
appendMethod · 0.45
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected