When I make a subclass of pygame.math.Vector2 and do a scalar multiplication, it results in a crash and a Fatal Error
importpygameclassVector(pygame.math.Vector2):
pass# this stuff works finevec_a=Vector(2, 0)
vec_b=Vector(0, 1)
print(vec_a+vec_b)
print(vec_a.length())
print(vec_a.normalize())
vec_c=vec_a.rotate(90)
print(vec_c)
# but this raises the Errorvec_a*=2
Added new function that tests a subclassed math.Vector2 for issue pygame#552.
This is my first contribution on Github, so any feedback if necessary would be greatly appreciated!
christianpostprivate commentedOct 9, 2018
When I make a subclass of pygame.math.Vector2 and do a scalar multiplication, it results in a crash and a Fatal Error
The Error message I get is
Reproducability: I only tried this on two Windows 7 PCs with python 3.6 and in Spyder. Pygame Version is 1.9.3
Also someone on reddit said they got the same error
https://www.reddit.com/r/learnpython/comments/9mnu4b/making_an_existing_class_hashable_pygame_vector/
The text was updated successfully, but these errors were encountered: