You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is a corner case that need to be note.
the object used as an index of a list, can be something other than int or slice.
it may be any object with an __index__ method which returns an int. for example, uint8 from numpy is not a subclass of pythons built in int. therefore, it cant be used as index of ListTag. (but it can be used as index of IntArrayTag)
i suggest to add a attribute in Path object: "isNbtPath". then we can use hasattr(index, "isNbtPath") to know if it is a nbt_Path.
The text was updated successfully, but these errors were encountered:
nbtlib/nbtlib/tag.py
Line 982 in a6c0cd9
there is a corner case that need to be note.
the object used as an index of a list, can be something other than int or slice.
it may be any object with an
__index__
method which returns an int. for example, uint8 from numpy is not a subclass of pythons built inint
. therefore, it cant be used as index of ListTag. (but it can be used as index of IntArrayTag)i suggest to add a attribute in Path object: "isNbtPath". then we can use hasattr(index, "isNbtPath") to know if it is a nbt_Path.
The text was updated successfully, but these errors were encountered: