Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvitousek committed Jul 28, 2016
1 parent 416167a commit e478343
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion retic/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def check_type_string(val):
return val if isinstance(val, str) else rse()

def check_type_function(val):
return val if callable(val) else rse()
return val if callable(val) or isinstance(val, classmethod) else rse()

def check_type_list(val):
return val if (isinstance(val, list)) else rse()
Expand Down
2 changes: 2 additions & 0 deletions retic/typefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def visitFunctionDef(self, n, vty, aliases, misc):
elif isinstance(dec, ast.Name) and dec.id == 'returns':
separate = True
septo = typeparse(dec.args[0], aliases)
elif isinstance(dec, ast.Name) and dec.id == 'staticmethod':
return {Var(n.name, n): Dyn}
else: continue

if separate:
Expand Down
2 changes: 1 addition & 1 deletion tests/func2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ def o(a:Function([int], int)):
def p(x):
x(10)

p(10)
p(o)

0 comments on commit e478343

Please sign in to comment.