Skip to content

Conversation

@icoder-new
Copy link

@icoder-new icoder-new commented Mar 13, 2021

https://bugs.python.org/issue43488

What's new in Vector (vector.py)

  • Added __mul__ (Vector and Vector)
  • Added __truediv (Vector and Vector) and (Vector and scalar)
  • Added __floordiv__ (Vector and Vector) and (Vector and scalar)
  • Added __mod__ (Vector and Vector) and (Vector and scalar)

This new methods is very useful!
It is beta version! By the way we will fix bugs

@icoder-new icoder-new changed the title Update vector.py bpo-43488 Update vector.py Mar 13, 2021
Comment on lines 62 to 65
def __mul__(self, scalar):
# Multiply by scalar
v = [x * scalar for x in self.v]
return Vec.fromlist(v)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I delete it coz, its only use scalar!

@rhettinger rhettinger closed this Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants