Skip to content

Commit

Permalink
Fix Sliceable instance check
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Nov 24, 2023
1 parent 1bf1dea commit a5014f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _SliceableType(type):
def __instancecheck__(self, instance):
if isinstance(instance, str):
return False
return isinstance(instance, Shaped) and hasattr(instance, '__getitem__')
return isinstance(instance, Shaped) and (hasattr(instance, '__getitem__') or isinstance(instance, PhiTreeNode))

def __subclasscheck__(self, subclass):
if subclass == str:
Expand Down

0 comments on commit a5014f8

Please sign in to comment.