-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
As a user it would be nice to have the dup() and copy() functions available on the list, tuple and set type.
Describe the solution you'd like
When using .dup() or .copy() I would expect a duplicate of the list/set/tuple. The items should not being duplicated unless a specific deep argument is given. This means the default should be deep 0 and without a deep argument both copy and dup should have the same result.
Example:
x = range(10);
y = x.dup(); // or x.copy();
assert ( x == y );The functions dup() and copy() start to be different when a deep argument is given and at least one of the item is a typed thing. In this case the function dup will create a duplicate of the typed thing of the same type whereas copy will always create a new thing and looses the type information.