Skip to content

Clarify difference between copy.copy() and the copy() methods #150636

@serhiy-storchaka

Description

@serhiy-storchaka

The copy module documentation mention dict.copy() and list slicing as yet one way of making slice copies. This is true, but there is a subtle difference. dict.copy() returns the instance of dict when copying an instance of the dict subclass, unless it overrides the copy() method. The same for slicing.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesdocsDocumentation in the Doc dir
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions