Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 3117b01

Browse files
author
Matthias Koeppe
committed
MixedIntegerLinearProgram.__deepcopy__: Add another doctest
1 parent 38c6be9 commit 3117b01

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/sage/numerical/mip.pyx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,19 @@ cdef class MixedIntegerLinearProgram(SageObject):
570570
sage: cp = deepcopy(p)
571571
sage: cp.solve()
572572
6.0
573+
574+
TEST:
575+
576+
Test that `deepcopy` makes actual copies but preserves identities::
577+
578+
sage: mip = MixedIntegerLinearProgram()
579+
sage: ll = [mip, mip]
580+
sage: dcll=deepcopy(ll)
581+
sage: ll[0] is dcll[0]
582+
False
583+
sage: dcll[0] is dcll[1]
584+
True
585+
573586
"""
574587
return self.__copy__()
575588

0 commit comments

Comments
 (0)