Skip to content

Commit

Permalink
Vector accepts dict{x,y,z}
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjum committed Jan 31, 2016
1 parent 828b9bc commit 84dff18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spockbot/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ def __init__(self, *xyz):
l = len(xyz)
if l == 1:
obj = xyz[0]
xyz = obj.x, obj.y, obj.z
try:
xyz = obj.x, obj.y, obj.z
except AttributeError:
xyz = obj['x'], obj['y'], obj['z']
elif l == 0:
xyz = (0, 0, 0)
elif l != 3:
Expand Down

0 comments on commit 84dff18

Please sign in to comment.