3 ms·
> Is storing objects of any type a common use case, compared to storing objects of one type? I'm not sure it's possible to know a general answer to that, since
by pdonis 5y ago
> Is storing objects of any type a common use case, compared to storing objects of one type?
I'm not sure it's possible to know a general answer to that, since Python is used in such a wide variety of contexts.
In my own programming, I use lists that can contain objects of different types often enough for that use case to be significant for me.
One other thing to keep in mind is that Python has duck typing, so, for example, if you are iterating over a list and retrieving the same attribute or calling the same method on each object, that doesn't require each object to be of the same type, just to have an attribute with the required name, or a method with the required name and calling signature.