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

Class ChannelState

Lib/test/test__interpchannels.py:173–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172
173class ChannelState(namedtuple('ChannelState', 'pending closed')):
174
175 def __new__(cls, pending=0, *, closed=False):
176 self = super().__new__(cls, pending, closed)
177 return self
178
179 def incr(self):
180 return type(self)(self.pending + 1, closed=self.closed)
181
182 def decr(self):
183 return type(self)(self.pending - 1, closed=self.closed)
184
185 def close(self, *, force=True):
186 if self.closed:
187 if not force or self.pending == 0:
188 return self
189 return type(self)(0 if force else self.pending, closed=True)
190
191
192def run_action(cid, action, end, state, *, hideclosed=True):

Callers 2

__new__Method · 0.85
run_actionMethod · 0.85

Calls 1

namedtupleFunction · 0.90

Tested by 2

__new__Method · 0.68
run_actionMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…