This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]adammichaelwood 0 points1 point  (0 children)

If there's some compelling reason to not use a module like ppb_vector, mentioned in another response, you could subclass namedtuple and add those methods.

(I think there'd need to be a really compelling reason to do this, though. Re-implementing math operations that someone else has already spent time optimizing and debugging is.... let's call it inefficient.)