Re: [sage-devel] A bug due to copying a cython object.

2019-05-17 Thread Kwankyu Lee
This is now

https://trac.sagemath.org/ticket/27844

which needs review.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/3bfa8aeb-e6db-4188-aff5-39215107c0c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] A bug due to copying a cython object.

2019-05-17 Thread Jeroen Demeyer

On 2019-05-17 10:02, Kwankyu Lee wrote:

What is the proper way to copy a cython object with all its attributes?


Write a __copy__ method doing the copy manually. Unless I'm missing a 
Cython feature that helps with this.


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5CDE86DA.4090107%40UGent.be.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] A bug due to copying a cython object.

2019-05-17 Thread Kwankyu Lee
Hi,

I observed

sage: F = GF(2)
sage: E = GF(4)
sage: phi = E.coerce_map_from(F); phi
Ring morphism:
  From: Finite Field of size 2
  To:   Finite Field in z2 of size 2^2
  Defn: 1 |--> 1
sage: phi.section()
---
TypeError Traceback (most recent call last)
...
TypeError: 'NoneType' object is not callable

and on the other hand,

sage: psi = E._internal_coerce_map_from(F)
sage: psi.section()
Section of (map internal to coercion system -- copy before use)
Ring morphism:
  From: Finite Field of size 2
  To:   Finite Field in z2 of size 2^2

If you look into coerce_map_from() method, essentially phi = copy(psi), but 
while copying the cython object, the information about the section map of 
psi is lost, and thus the error above.

What is the proper way to copy a cython object with all its attributes?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/c8d673a8-dabb-44bd-87f0-634ebb42b078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.