On Mon, Oct 14, 2019 at 9:09 AM Steven D'Aprano
On Sun, Oct 13, 2019 at 07:20:29PM -0000, Steve Jorgensen wrote:
Failing fast is good, but it is also a very common case to want to add an item to a collection regardless of whether it is set-like or sequence-like.
Is that correct though? To the best of my memory, I've never wanted to add an item to a list-or-set in 15 years, nor have I seen code in practice that does so. I don't think it is "very common", but I would like to see some examples of your code, and third-party libraries, which do this.
I don't often actually want to add to list-or-set, but I do sometimes have half-written code using one or the other, and then a future design constraint makes me rethink my choice of data type. Oh, now I have to change how I'm adding those items. It'd be helpful to have the API more consistent, but I don't actually need it to be polymorphic per se. ChrisA