Skip to content

Add dup() and copy() to set, list and tuple type. #265

@joente

Description

@joente

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions