On Thursday, May 25, 2017 at 4:36:49 PM UTC-7, Nils Bruin wrote: > > > TypeError: __str__ returned non-string (type bytes) > > which happens in the Parent stuff for "rings/infinity.py" somewhere. The > problem is clear: we end up with some byte string from what should be a > "str". I don't know where, though. Do "cdef str" objects coerce into > "object" as a "str" or as a "bytes"? Probably the latter ... this could be > painful. >
Found the problem: it's in SageObject.__repr__ (triggered by the formation of an error message in sage.rings.ring.is_field). I've pushed a solution to my nbruin/py3_compat, but I don't see how to solve this in a way that works on both py2 and py3. We're going to have a lot of unicode problems ... Another weird one occurs in cdef class RealNumber(sage.structure.element.RingElement): .... def __hex__(self): .... hex = __hex__ On python3, this gives a runtime error: NameError: name '__hex__' is not defined so it looks like the order in which class initialization code is executed is different between py2 and py3. It would be good to know how to solve alias initialization in a py3 cdef class. -- 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.