vecrec.accept_anything_as_vector

vecrec.accept_anything_as_vector(function)[source]

Method decorator that converts an argument to a vector.

Examples:

>>> import vecrec
>>> class MyClass:
...     @vecrec.accept_anything_as_vector
...     def f(self, v):
...         return v
...
>>> x = MyClass()
>>> x.f(1, 2)
Vector(1.000000, 2.000000)
>>> x.f((1, 2))
Vector(1.000000, 2.000000)