Skip to content

Commit

Permalink
Optimize: skip non-callables
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Oct 21, 2024
1 parent b3e3047 commit 0d03277
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymbolic/mapper/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ def wrapper(cls: type) -> type:
for name in dir(cls):
if not name.startswith("__") or name == "__call__":
method = getattr(cls, name)
if isinstance(method, (property, cached_property)):
if (not callable(method)
or isinstance(method, (property, cached_property))):
# properties don't have *args, **kwargs
continue

Expand Down

0 comments on commit 0d03277

Please sign in to comment.