MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / __contains__

Method __contains__

src/__init__.py:14566–14581  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

14564 return not (max(self) == min(self) == 0)
14565
14566 def __contains__(self, x):
14567 if hasattr(x, "__float__"):
14568 return x in tuple(self)
14569 l = len(x)
14570 if l == 2:
14571 return util_is_point_in_rect(x, self)
14572 if l == 4:
14573 r = INFINITE_RECT()
14574 try:
14575 r = Rect(x)
14576 except Exception:
14577 if g_exceptions_verbose > 1: exception_info()
14578 r = Quad(x).rect
14579 return (self.x0 <= r.x0 <= r.x1 <= self.x1 and
14580 self.y0 <= r.y0 <= r.y1 <= self.y1)
14581 return False
14582
14583 def __eq__(self, rect):
14584 if not hasattr(rect, "__len__"):

Callers 1

containsMethod · 0.95

Calls 5

util_is_point_in_rectFunction · 0.85
INFINITE_RECTFunction · 0.85
RectClass · 0.85
exception_infoFunction · 0.85
QuadClass · 0.85

Tested by

no test coverage detected