mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41720: Add "return NotImplemented" in turtle.Vec2D.__rmul__(). (GH-22092)
(cherry picked from commit fd4cafd470
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
c73ee5acc9
commit
1671b0e4e0
3 changed files with 19 additions and 2 deletions
|
@ -258,6 +258,7 @@ class Vec2D(tuple):
|
|||
def __rmul__(self, other):
|
||||
if isinstance(other, int) or isinstance(other, float):
|
||||
return Vec2D(self[0]*other, self[1]*other)
|
||||
return NotImplemented
|
||||
def __sub__(self, other):
|
||||
return Vec2D(self[0]-other[0], self[1]-other[1])
|
||||
def __neg__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue