Error when trying to overload an operator “/”

I recently start teaching myself game programming. Someone recommend me to start with Python and I got the book “Beginning game development with Python and Pygame: From novice to professional”. I got to a part where they teach about Vectors and creating a Vector2 class. Everything was going well until I tried to overload the division operator.
My code goes like this:

Calling a PyGame Function, from clicking a Object-Orientated PyGame Button

import pygame as pg import sys pg.init() buttonFont = pg.font.SysFont("garamond", 25) screenGray = pg.Color('gray80') buttonGray2 = pg.Color('gray50') textColour = pg.Color('navy') screen = pg.display.set_mode((800, 600)) clock = pg.time.Clock() class Button(pg.sprite.Sprite): def __init__(self, text, x, y, width, height, colour): super().__init__() self.image = pg.Surface((width, height)) self.image.fill(colour) self.rect = self.image.get_rect() txt = buttonFont.render(text, True, textColour) txtRect = txt.get_rect(center = … Read more