D
[[0]]
class koala:
def __getitem__(self, i):
return self
x = koala()
x[0] == x
>>> a = []
>>> a.append(a)
>>> a
[[...]]
>>> a[0] == a
True
>>> x = {}
>>> x[0] = x
>>> x[0]
{0: {...}}
>>> x[0] == x
True
Non-integer hashable types don't work with a recursive list
I'm not worried about it, I was just generalizing.lostnihilist":2otne96u said:Why would you worry about this?
Now why would you go and assume that? As has been demonstrated, it could also be a class or a dictionary.and":2otne96u said:I assume x[0] implies a sequence, and so only integer indices are important.