Skip to content

bpo-43488 Update vector.py #24845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

bpo-43488 Update vector.py #24845

wants to merge 6 commits into from

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