Modernize code to Python 3.6+ and some cleanup
This commit is contained in:
@@ -26,7 +26,6 @@ Scalar multiplication::
|
||||
>>> abs(v * 3)
|
||||
15.0
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -39,7 +38,7 @@ class Vector:
|
||||
self.y = y
|
||||
|
||||
def __repr__(self):
|
||||
return 'Vector(%r, %r)' % (self.x, self.y)
|
||||
return f'Vector({self.x!r}, {self.y!r})'
|
||||
|
||||
def __abs__(self):
|
||||
return hypot(self.x, self.y)
|
||||
|
||||
Reference in New Issue
Block a user