Context: I am playing around with implementing abstract algebraic groups 
which are recovered from based root data. 
So, one should eventually be able to say
b = BasedRootDatum( suitable input )
g = AbstractAlgebraicGroup( b )
Running into an issue which seems to be triggered by the passing of a BRD 
object to the AAG constructor. 

Full error message below. Having stripped away everything that does not 
seem to have a role in producing the error, 
I get the error with just the following: 

based_root_datum.py reads: 

*from sage.structure.sage_object import SageObject*


*class BasedRootDatum(SageObject):*

*    def __init__(self):*

*        one = 1 # placeholder*



*    def __repr__(self):*

*        return "Based root datum"*



while abstract_algebraic_group.py reads 


*from sage.structure.parent import Parent*

*from sage.structure.unique_representation import UniqueRepresentation*


*class AbstractAlgebraicGroup(Parent,  UniqueRepresentation):*


*    def __init__(self, BRD, base_ring, system):*

*        two = 2 #placeholder*



*    def __repr__(self):*


*        return "Abstract Algebraic Group"*



Here's the full error message.


---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-2-59aff55a6b05> in <module>()

----> 1 g=AbstractAlgebraicGroup(b)


/Users/jahundle/sage/src/sage/misc/lazy_import.pyx in 
sage.misc.lazy_import.LazyImport.__call__ 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/lazy_import.c:3636)()

*    384*             True

*    385*         """

--> 386         return self._get_object()(*args, **kwds)

*    387* 

*    388*     def __repr__(self):


/Users/jahundle/sage/src/sage/misc/classcall_metaclass.pyx in 
sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/classcall_metaclass.c:1251)
()

*    328*         """

*    329*         if cls.classcall is not None:

--> 330             return cls.classcall(cls, *args, **kwds)

*    331*         else:

*    332*             # Fast version of type.__call__(cls, *args, **kwds)


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.CachedFunction.__call__ 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:5545)()

*   1054*                 return self.cache[k]

*   1055*             except TypeError:  # k is not hashable

-> 1056                 k = dict_key(k)

*   1057*                 return self.cache[k]

*   1058*         except KeyError:


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.dict_key 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:2650)()

*    600*         hash(o)

*    601*     except TypeError:

--> 602         o = (unhashable_key, cache_key_unhashable(o))

*    603*     return o

*    604* 


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.cache_key_unhashable 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:3160)()

*    649*     """

*    650*     if isinstance(o, tuple):

--> 651         return tuple(cache_key(item) for item in o)

*    652*     try:

*    653*         k = o._cache_key()


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in genexpr 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:3060)()

*    649*     """

*    650*     if isinstance(o, tuple):

--> 651         return tuple(cache_key(item) for item in o)

*    652*     try:

*    653*         k = o._cache_key()


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.cache_key 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:2851)()

*    640*         hash(o)

*    641*     except TypeError:

--> 642         o = cache_key_unhashable(o)

*    643*     return o

*    644* 


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.cache_key_unhashable 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:3160)()

*    649*     """

*    650*     if isinstance(o, tuple):

--> 651         return tuple(cache_key(item) for item in o)

*    652*     try:

*    653*         k = o._cache_key()


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in genexpr 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:3060)()

*    649*     """

*    650*     if isinstance(o, tuple):

--> 651         return tuple(cache_key(item) for item in o)

*    652*     try:

*    653*         k = o._cache_key()


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.cache_key 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:2851)()

*    640*         hash(o)

*    641*     except TypeError:

--> 642         o = cache_key_unhashable(o)

*    643*     return o

*    644* 


/Users/jahundle/sage/src/sage/misc/cachefunc.pyx in 
sage.misc.cachefunc.cache_key_unhashable 
(/Users/jahundle/sage/src/build/cythonized/sage/misc/cachefunc.c:3215)()

*    651*         return tuple(cache_key(item) for item in o)

*    652*     try:

--> 653         k = o._cache_key()

*    654*     except AttributeError:

*    655*         raise TypeError("unhashable type: {!r}".format(type(o).
__name__))


/Users/jahundle/sage/src/sage/structure/sage_object.pyx in 
sage.structure.sage_object.SageObject._cache_key 
(/Users/jahundle/sage/src/build/cythonized/sage/structure/sage_object.c:3033)
()

*    408*             hash(self)

*    409*         except TypeError:

--> 410             raise TypeError("{} is not hashable and does not 
implement _cache_key()".format(type(self)))

*    411*         else:

*    412*             assert False, "_cache_key() must not be called for 
hashable elements"


TypeError: <class 'sage.groups.alg_gps.based_root_datum.BasedRootDatum'> is 
not hashable and does not implement _cache_key()

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to