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

Class FormatReplace

pager_lib/tqdm/utils.py:102–114  ·  view source on GitHub ↗

>>> a = FormatReplace('something') >>> f"{a:5d}" 'something'

Source from the content-addressed store, hash-verified

100
101
102class FormatReplace:
103 """
104 >>> a = FormatReplace('something')
105 >>> f"{a:5d}"
106 'something'
107 """ # NOQA: P102
108 def __init__(self, replace=''):
109 self.replace = replace
110 self.format_called = 0
111
112 def __format__(self, _):
113 self.format_called += 1
114 return self.replace
115
116
117class Comparable:

Callers 1

format_meterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected