def __isub__(self, other):
"""Resta un vector con otro"""
if isinstance(other, Vector3):
self.x -= other.get_x()
self.y -= other.get_y()
self.z -= other.get_z()
return self
elif isinstance(other, types.TupleType) or isinstance(other, types.ListType):
if len(other) == 3:
self.x -= other[0]
self.y -= other[1]
self.z -= other[2]
return self
else:
self.throwError(2, "__isub__")
return self
评论列表
文章目录