[issue33519] Should MutableSequence provide .copy()?

Raymond Hettinger report at bugs.python.org
Tue May 15 19:35:15 EDT 2018


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Should we add .copy() to the ABC or remove the promise that all mutable sequences implement .copy()?

The second option would be best.  Let's just clarify that copy() isn't part of the MutableSequence API.

The first option isn't really a choice be it would break existing uses that don't implement copy and because the ABC have a reliable way to create a new instance using the given abstract methods (it has no way of even knowing whether the data is stored locally, in a database, or updated through a REST API, it may not even be possible to reliably create an independent instance).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33519>
_______________________________________


More information about the Python-bugs-list mailing list