MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / __eq__

Method __eq__

scenedetect/common.py:544–554  ·  view source on GitHub ↗
(self, other: "TimecodeLike")

Source from the content-addressed store, hash-verified

542 raise TypeError("Cannot obtain frame number for this timecode.")
543
544 def __eq__(self, other: "TimecodeLike") -> bool:
545 if other is None:
546 return False
547 if _compare_as_fixed(other, self):
548 return self.frame_num == other.frame_num
549 # For integer comparison, use frame numbers to avoid floating point precision issues.
550 if isinstance(other, int):
551 return self.frame_num == other
552 if isinstance(self._time, (Timecode, _Seconds)):
553 return self.seconds == self._get_other_as_seconds(other)
554 return self.frame_num == self._get_other_as_frames(other)
555
556 def __ne__(self, other: "TimecodeLike") -> bool:
557 if other is None:

Callers

nothing calls this directly

Calls 3

_get_other_as_secondsMethod · 0.95
_get_other_as_framesMethod · 0.95
_compare_as_fixedFunction · 0.85

Tested by

no test coverage detected