This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Devin Jeanpierre
Recipients Devin Jeanpierre, martin.panter, rhettinger
Date 2015-01-04.11:56:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420372599.57.0.795552069386.issue23161@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-01-04 11:56:39Devin Jeanpierresetrecipients: + Devin Jeanpierre, rhettinger, martin.panter
2015-01-04 11:56:39Devin Jeanpierresetmessageid: <1420372599.57.0.795552069386.issue23161@psf.upfronthosting.co.za>
2015-01-04 11:56:39Devin Jeanpierrelinkissue23161 messages
2015-01-04 11:56:39Devin Jeanpierrecreate