3 ms·
You'll get surprises such as your subclass being indexable when you (probably) don't want that.
by joshuamorton 10y ago
You'll get surprises such as your subclass being indexable when you (probably) don't want that.
- lgas 10y agoWhat problem would that cause? Wouldn't it only be a problem if you attempted to index into it, which you wouldn't do (on purpose) if you didn't think it was indexable? And if you did try to index into it thinking that it wasn't indexable, it would be a bug, which is the same as when it's indexable...
- joshuamorton 10y agoExactly. You probably don't want this thing that is essentially a namespace to be indexable, but you index into it, which is a bug, but it quacks like a tuple, so your mistake propagates silently, which is a bad thing. Its more permissive than one would expect. Although the bigger issue is what dragonne mentioned.