performs the comparison between two vectors
(self, other: object)
| 96 | raise Exception("must have the same size") |
| 97 | |
| 98 | def __eq__(self, other: object) -> bool: |
| 99 | """ |
| 100 | performs the comparison between two vectors |
| 101 | """ |
| 102 | if not isinstance(other, Vector): |
| 103 | return NotImplemented |
| 104 | if len(self) != len(other): |
| 105 | return False |
| 106 | return all(self.component(i) == other.component(i) for i in range(len(self))) |
| 107 | |
| 108 | @overload |
| 109 | def __mul__(self, other: float) -> Vector: ... |