Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[with additional patch] problem with copy() on sage.rings.integer_mod.IntegerMod_gmp #2571

Closed
dfdeshom opened this issue Mar 17, 2008 · 7 comments

Comments

@dfdeshom
Copy link

John Cremona:

sage: a=[Mod(2,next_prime(2^n)) for n in range(28,35)]
sage: [type(x) for x in a]

[<type 'sage.rings.integer_mod.IntegerMod_int64'>,
 <type 'sage.rings.integer_mod.IntegerMod_int64'>,
 <type 'sage.rings.integer_mod.IntegerMod_int64'>,
 <type 'sage.rings.integer_mod.IntegerMod_gmp'>,
 <type 'sage.rings.integer_mod.IntegerMod_gmp'>,
 <type 'sage.rings.integer_mod.IntegerMod_gmp'>,
 <type 'sage.rings.integer_mod.IntegerMod_gmp'>]

sage: [copy(x) for x in a]
[2, 2, 2, None, None, None, None]

sage: [deepcopy(x) for x in a]
[2, 2, 2, 2, 2, 2, 2]

Component: basic arithmetic

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

@JohnCremona
Copy link
Member

Attachment: 8950.patch.gz

@JohnCremona
Copy link
Member

comment:1

To fix this I added a return statement to the __copy__() function of IntegerMod_gmp. Patch attached (based on 2.10.4.rc0)

@dfdeshom
Copy link
Author

comment:2

While you're editing that function, would you mind adding a doctest or 2 to it? That would help with the overall 3.0 goal of >50% function doctest coverage

@JohnCremona
Copy link
Member

apply after 8950.patch

@JohnCremona
Copy link
Member

comment:3

Attachment: 8951.patch.gz

As suggested, a few doctests have been added, in the second patch.

@JohnCremona JohnCremona changed the title problem with copy() on sage.rings.integer_mod.IntegerMod_gmp [with additional patch] problem with copy() on sage.rings.integer_mod.IntegerMod_gmp Mar 17, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.11 milestone Mar 17, 2008
@sagetrac-jbmohler
Copy link
Mannequin

sagetrac-jbmohler mannequin commented Mar 18, 2008

comment:5

These patches fix the bug and add and improve documentation bits. I've tested everything I could see that could go wrong (including the copy and sqrt/square_root change) and all looks good to me.

This is a positive review to both patches!

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 19, 2008

comment:6

Merged both patches in Sage 2.11.alpha0

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Mar 19, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants