Devin Jeanpierre added the comment: copy() should not be implemented magically, no.
I understand the argument in favor of not implementing redundant methods, but if the redundancy was this big a concern, they should not have been added to sets in the first place. The current ABCs are inconsistent and confusing. For example: MutableSequence implements += and .extend, but on MutableSet, the analogous methods |= and .update are only half there. (Moreover, it's the wrong half, in my experience.) Plus not all of the named methods have operator equivalents, so e.g. is_subset is not supported, but is_disjoint is. This also means every subclass, in order to actually implement the set API, needs to write this code itself. It is very common to call the named methods, especially ones like update, and compatibility with set is desirable -- otherwise, we wouldn't bother inheriting from the relevant ABC. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23161> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com