Skip to content
Snippets Groups Projects
Commit 2064aacc authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

.

parent 6da40943
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,6 @@ def typed(*t_args, **t_kwargs):
"""
t_args = [(__typeinfo_to_tuple_of_types(x) if x is not None else None) for x in t_args]
t_retarg = t_kwargs.get('returns', None)
is_mandatory = t_kwargs.get('mandatory', False)
......@@ -275,14 +274,13 @@ def typed(*t_args, **t_kwargs):
t_retarg = __typeinfo_to_tuple_of_types(t_retarg)
def outer(fun):
if (not __debug__) and (not is_mandatory):
return fun
@functools.wraps(fun)
def inner(*args, **kwargs):
if isinstance(fun, types.MethodType) or inspect.ismethod(fun) or hasattr(fun, 'im_class'): # instancemethod or classmethod
if isinstance(fun, types.MethodType) or inspect.ismethod(fun): # instancemethod or classmethod
cargs = args[1:]
else:
cargs = args
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment