Trivia Python question

  • Thread starter Deleted member 43669
  • Start date
Status
Not open for further replies.

lostnihilist

Ars Scholae Palatinae
1,436
Non-integer hashable types don't work with a recursive list

Why would you worry about this? I assume x[0] implies a sequence, and so only integer indices are important. The recursive example works for an arbitrary index. Just keep appending the list to itself until you have enough of a list that you don't get an IndexError.
 

Alamout

Ars Legatus Legionis
27,285
lostnihilist":2otne96u said:
Why would you worry about this?
I'm not worried about it, I was just generalizing. :p

and":2otne96u said:
I assume x[0] implies a sequence, and so only integer indices are important.
Now why would you go and assume that? As has been demonstrated, it could also be a class or a dictionary.
 
Status
Not open for further replies.