Hi there,

I'm having trouble with coercion in sage 4.2...
The following (reduced) example works with sage 4.1.2 and breaks with sage
4.2. Here is the error:

      File "<doctest __main__.example_0[2]>", line 1, in <module>
        bla = Essai(); bla###line 11:
    sage: bla = Essai(); bla
      File "/home/averell/.sage/tmp/wrapp.py", line 16, in __init__
        mor.register_as_coercion()
      File "morphism.pyx", line 116, in 
sage.categories.morphism.Morphism.register_as_coercion 
(sage/categories/morphism.c:2371)
      File "parent.pyx", line 1018, in 
sage.structure.parent.Parent.register_coercion (sage/structure/parent.c:8301)
      File "parent.pyx", line 1043, in 
sage.structure.parent.Parent.register_coercion (sage/structure/parent.c:8090)
    AssertionError: coercions must all be registered up before use

Any help or suggestion ?

Cheers,

Florent



      
from sage.structure.parent import Parent
from sage.rings.integer_ring import IntegerRing
from sage.categories.homset import Hom
class Essai(Parent):
    """
    TESTS::

        sage: bla = Essai(); bla
        <class 'wrapp.Essai'>
    """
    def __init__(self):
        Parent.__init__(self)
        mor = Hom(self, IntegerRing())(lambda z: 1)
        mor.register_as_coercion()

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to