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 22, 2024
1 parent e5841fa commit e355f08
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 e355f08

Please sign in to comment.