Salut Aladin ! Words currently do not fit well with category... (for example they do not inherit from parent). But there is #12224 that I hope to finish at Sage days 57. By the way do you plan to come ?
For your problem, a stupid strategy of the conversion mechanism in Sage from X to Y is to ask for X an element x (via an_element()) and then try Y(x). It makes many things annoying ! On the other hand, there is no real specifications for "x in X" and I guess that until we fix it we should avoid it. Best, Vincent 2014-02-13 7:53 UTC+01:00, David Roe <roed.m...@gmail.com>: >> sage: W([1,2]) in ZZ >> --------------------------------------------------------------------------- >> NotImplementedError Traceback (most recent call >> last) >> <ipython-input-30-ef733470b649> in <module>() >> ----> 1 W([Integer(1),Integer(2)]) in ZZ >> [...] >> >> NotImplementedError: please implement _an_element_ for Words over {1, 2, >> 3, 4} >> >> It is easy to fix by adding the _an_element_ method to W by doing: >> >> sage: W._an_element_ = lambda : W() >> sage: W([1,2]) in ZZ >> False >> > > _an_element_ should return an element of W, rather than None. Other than > that, I'm not sure whether W is deficient coercion-wise in any other way; > should there be coercions from anywhere? > David > > -- > 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 http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.