We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e11fb7 commit 42568ffCopy full SHA for 42568ff
adafruit_turtle.py
@@ -89,6 +89,9 @@ class Vec2D(tuple):
89
May be useful for turtle graphics programs also.
90
Derived from tuple, so a vector is a tuple!
91
"""
92
+ def __new__(cls, x, y):
93
+ self = super().__new__(cls, (x, y))
94
+ return self
95
96
# Provides (for a, b vectors, k number):
97
# a+b vector addition
@@ -97,8 +100,8 @@ class Vec2D(tuple):
100
# k*a and a*k multiplication with scalar
98
101
# |a| absolute value of a
99
102
# a.rotate(angle) rotation
- def __init__(self, x, y):
- super().__init__((x, y))
103
+ # def __init__(self, x, y):
104
+ # super().__init__((x, y))
105
106
def __add__(self, other):
107
return Vec2D(self[0] + other[0], self[1] + other[1])
0 commit comments