MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __new__

Method __new__

pager_lib/tqdm/std.py:663–677  ·  view source on GitHub ↗
(cls, *_, **__)

Source from the content-addressed store, hash-verified

661 f'{n_fmt}{unit} [{elapsed_str}, {rate_fmt}{postfix}]')
662
663 def __new__(cls, *_, **__):
664 instance = object.__new__(cls)
665 with cls.get_lock(): # also constructs lock if non-existent
666 cls._instances.add(instance)
667 # create monitoring thread
668 if cls.monitor_interval and (cls.monitor is None
669 or not cls.monitor.report()):
670 try:
671 cls.monitor = TMonitor(cls, cls.monitor_interval)
672 except Exception as e: # pragma: nocover
673 warn("tqdm:disabling monitor support"
674 " (monitor_interval = 0) due to:\n" + str(e),
675 TqdmMonitorWarning, stacklevel=2)
676 cls.monitor_interval = 0
677 return instance
678
679 @classmethod
680 def _get_free_pos(cls, instance=None):

Callers

nothing calls this directly

Calls 4

TMonitorClass · 0.85
get_lockMethod · 0.80
addMethod · 0.80
reportMethod · 0.80

Tested by

no test coverage detected