adafruit/Adafruit_CircuitPython_turtle

'Vec2D' object is not subscriptable

Closed this issue · 1 comments

Duplicate of adafruit/circuitpython#2503. Opened here to help users who may look here. See the link for a full explanation.

A simple workaround if you run into this is to change the Vec2D class to have a tuple instead of extending tuple:

class Vec2D(object):
    def __init__(self, x, y):
        self.tup = (x, y)

    def __getitem__(self, i):
        return self.tup[i]