Skip to content

Commit

Permalink
Do not check filters for dunder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AryazE committed Aug 30, 2024
1 parent fc6ee78 commit 893e0cc
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/dynapyt/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,20 @@ def call_if_exists(self, f, *args):
func = self.analysis_func(analysis, f)
if func is None:
continue
args_for_filter = []
for arg in args[2:]:
if type(arg) is list or type(arg) is dict:
pass
else:
try:
hash(arg)
args_for_filter.append(arg)
except:
if f.startswith("__") and f.endswith("__"):
is_filtered = False
else:
args_for_filter = []
for arg in args[2:]:
if type(arg) is list or type(arg) is dict:
pass
is_filtered = self.filtered(func, f, tuple(args_for_filter))
else:
try:
hash(arg)
args_for_filter.append(arg)
except:
pass
is_filtered = self.filtered(func, f, tuple(args_for_filter))

if len(args) < 2 or not is_filtered:
return_value = func(*args)
Expand Down

0 comments on commit 893e0cc

Please sign in to comment.