updade from Atlas repo

This commit is contained in:
Luciano Ramalho
2021-05-21 18:56:12 -03:00
parent c518bf851e
commit 8a330d822b
120 changed files with 2190 additions and 1184 deletions

View File

@@ -127,7 +127,7 @@ class Vector:
def __repr__(self):
components = reprlib.repr(self._components)
components = components[components.find('['):-1]
return 'Vector({})'.format(components)
return f'Vector({components})'
def __str__(self):
return str(tuple(self))
@@ -140,7 +140,7 @@ class Vector:
return tuple(self) == tuple(other)
def __abs__(self):
return math.sqrt(sum(x * x for x in self))
return math.hypot(*self)
def __bool__(self):
return bool(abs(self))