Skip to content

trivial __copy__ and __deepcopy__ methods for number types #32454

@mkoeppe

Description

@mkoeppe

(split out from #13811):

Most Sage objects are immutable. Nevertheless, copy and deepcopy make copies (through pickling/unpickling) for them because we have not provided the classes with __copy__ methods (which should just return the object) and __deepcopy__ methods (which in many cases should just return the object).

sage: a = 0
sage: copy(a) is a
False

In this ticket, we take care of the basic number types in sage.rings.

CC: @tscrim @mjungmath @nbruin @kwankyu

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 1eb313e

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32454

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions