vector2d examples updated after chapter 9 split

This commit is contained in:
Luciano Ramalho
2014-10-20 09:30:33 -02:00
parent 9da839023e
commit 812d416c15
6 changed files with 94 additions and 98 deletions

View File

@@ -79,7 +79,8 @@ class Vector2d:
return (i for i in (self.x, self.y))
def __repr__(self):
return 'Vector2d({!r}, {!r})'.format(*self)
class_name = type(self).__name__
return '{}({!r}, {!r})'.format(class_name, *self)
def __str__(self):
return str(tuple(self))