30
30
import gc
31
31
import math
32
32
import time
33
- import board
34
33
import displayio
35
34
36
35
__version__ = "0.0.0+auto.0"
@@ -80,7 +79,7 @@ def __init__(self):
80
79
pass
81
80
82
81
83
- class Vec2D ( tuple ) :
82
+ class Vec2D :
84
83
"""A 2 dimensional vector class, used as a helper class
85
84
for implementing turtle graphics.
86
85
May be useful for turtle graphics programs also.
@@ -95,7 +94,10 @@ class Vec2D(tuple):
95
94
# |a| absolute value of a
96
95
# a.rotate(angle) rotation
97
96
def __init__ (self , x , y ):
98
- super ().__init__ ((x , y ))
97
+ self .values = (x , y )
98
+
99
+ def __getitem__ (self , index ):
100
+ return self .values [index ]
99
101
100
102
def __add__ (self , other ):
101
103
return Vec2D (self [0 ] + other [0 ], self [1 ] + other [1 ])
@@ -147,6 +149,9 @@ def __init__(self, display=None, scale=1):
147
149
self ._display = display
148
150
else :
149
151
try :
152
+ # pylint: disable=import-outside-toplevel
153
+ import board
154
+
150
155
self ._display = board .DISPLAY
151
156
except AttributeError as err :
152
157
raise RuntimeError (
@@ -397,6 +402,7 @@ def goto(self, x1, y1=None):
397
402
398
403
setpos = goto
399
404
setposition = goto
405
+
400
406
# pylint:enable=too-many-branches,too-many-statements
401
407
402
408
def setx (self , x ):
0 commit comments