[Python-ideas] clear() method for lists
Terry Reedy
tjreedy at udel.edu
Thu Feb 11 21:36:34 CET 2010
On 2/11/2010 12:35 PM, Gerald Britton wrote:
> On Thu, Feb 11, 2010 at 10:38 AM, Tim Lesher<tlesher at gmail.com> wrote:
> Switching gears for a moment, what is the feeling regarding the copy()
> methods for dictionaries and sets? Are they truly redundant? Should
> they be deprecated? Should users be encouraged to use the copy module
> or just use "newdict = dict(olddict)" and "newset = set(oldset)" to
> build a new dictionary or set from an existing one?
I did not even know that they exist and do not know why they exist.
In my opinion, set(x) should special case s being a set/frozenset, and
maybe even a dict, and so whatever set.copy does now. Ditto for dict.
Terry Jan Reedy
More information about the Python-ideas
mailing list