MCPcopy Create free account
hub / github.com/microsoft/debugpy / __new__

Method __new__

tests/timeline.py:389–410  ·  view source on GitHub ↗
(cls, timeline, start, stop)

Source from the content-addressed store, hash-verified

387
388class Interval(tuple):
389 def __new__(cls, timeline, start, stop):
390 assert start is None or isinstance(start, Expectation)
391 assert stop is None or isinstance(stop, Expectation)
392 if not isinstance(stop, Occurrence):
393 timeline.expect_frozen()
394
395 occs = ()
396 if start is None:
397 start = timeline._beginning
398
399 for occ in start.and_following(up_to=stop):
400 if occ == stop:
401 break
402 if occ == start:
403 occs = occ.and_following(up_to=stop)
404 break
405
406 result = super().__new__(cls, occs)
407 result.timeline = timeline
408 result.start = start
409 result.stop = stop
410 return result
411
412 def __contains__(self, expectation):
413 return any(expectation.test(self[0], self[-1])) if len(self) > 0 else False

Callers

nothing calls this directly

Calls 2

expect_frozenMethod · 0.80
and_followingMethod · 0.80

Tested by

no test coverage detected