Skip to content

Commit

Permalink
version 0.5.2
Browse files Browse the repository at this point in the history
fix: ignore function and method on to_primitive
  • Loading branch information
songofhawk committed Feb 8, 2023
1 parent 3e74062 commit d8fbb9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions objtyping/objtyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def _convert(self, obj:Any, depth:int, objs_chain:Set):
"""
if obj is None or depth > self.max_depth:
return None
if inspect.isfunction(obj) or inspect.ismethod(obj):
return None

if not is_basic_type(obj) and id(obj) in objs_chain:
return f'$$recursive reference:{str(obj)}$$'
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
name="objtyping",

# version of the module
version="0.5.1",
version="0.5.2",

# Name of Author
author="Song Hui",
Expand Down

0 comments on commit d8fbb9a

Please sign in to comment.