geofront.util — Utilities

geofront.util.typed(function: function) → function

Automatically check argument types using function’s annotated parameters. For example, the following code will raise TypeError:

>>> @typed
... def add(a: int, b: int):
...     return a + b
...
>>> add('strings are not ', 'accepted')
Parameters:function (types.FunctionType) – a function to make automatically type checked