From e2e582ab03bcb10d4664895b8cc520181cbd240c Mon Sep 17 00:00:00 2001 From: GreenXenith <24834740+GreenXenith@users.noreply.github.com> Date: Mon, 24 Feb 2020 17:46:30 -0800 Subject: [PATCH] Allow empty y in new vector --- vector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector.py b/vector.py index e4d068e..0148d6e 100644 --- a/vector.py +++ b/vector.py @@ -5,9 +5,9 @@ def vec_or_num(x, y = None): return x class Vector: - def __init__(self, x = 0, y = 0): + def __init__(self, x = 0, y = None): self.x = float(x) - self.y = float(y) + self.y = float(y or x) def __repr__(self): return "Vector {{x: {0}, y: {1}}}".format(self.x, self.y)