From 7bb99edd9ac78bee36b6f748f3016a27ace9afce Mon Sep 17 00:00:00 2001 From: Raymond Hogenson Date: Sun, 16 Oct 2016 14:35:46 -0400 Subject: Add __unicode__ to Vector --- color.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'color.py') diff --git a/color.py b/color.py index c65252b..8f7f72c 100644 --- a/color.py +++ b/color.py @@ -50,6 +50,12 @@ class Vector(object): new_y = self.x * sintheta + self.y * costheta return self.__class__(new_x, new_y) + def __unicode__(self): + return '<{}, {}, {}>'.format(self.x, self.y, self.z) + + def __str__(self): + return unicode(self) + @property def components(self): -- cgit v1.3.1