Skip to content

Commit

Permalink
Another way of filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
AryazE committed Aug 30, 2024
1 parent 893e0cc commit a543353
Showing 1 changed file with 7 additions and 30 deletions.
37 changes: 7 additions & 30 deletions src/dynapyt/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,14 @@ def filtered(self, func, f, args):
sub_args = []
sub_arg_names = []
for arg in sub_args:
if (
isinstance(arg, tuple) or isinstance(arg, list) or isinstance(arg, dict)
) and len(arg) == 0:
continue
if type(arg) == tuple and len(arg) == 1:
arg = arg[0]
try:
name = arg.__dict__.get("__name__", None)
if name is not None:
sub_arg_names.append(name)
continue
else:
no_dict = True
except AttributeError:
no_dict = True
try:
if type(arg) in [int, str, float, bool]:
sub_arg_names.append(str(arg))
elif (
type(arg) is type(print)
or type(arg) is type(snake)
or type(arg) is type(self.set_coverage)
):
sub_arg_names.append(arg.__name__)
continue
except AttributeError:
no_name = True
if no_dict and no_name:
try:
sub_arg_names.append(str(arg))
except:
pass
if (
func.__name__ == "post_call"
and len(sub_args) > 0
and type(sub_args[0]) == super
):
sub_arg_names.append("super")
return_value = False
while START in docs:
start = docs.find(START)
Expand Down

0 comments on commit a543353

Please sign in to comment.