Skip to content

Commit

Permalink
Vector3 accepts tuple/list/... as first argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjum committed Jan 31, 2016
1 parent a1d4da6 commit da63be9
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 @@ -161,7 +161,10 @@ def __init__(self, *xyz):
try:
xyz = obj.x, obj.y, obj.z
except AttributeError:
xyz = obj['x'], obj['y'], obj['z']
try:
xyz = obj['x'], obj['y'], obj['z']
except TypeError:
xyz = tuple(obj[:3])
elif l == 0:
xyz = (0, 0, 0)
elif l != 3:
Expand Down

0 comments on commit da63be9

Please sign in to comment.