Hi Robert! On 28 Feb., 21:00, Robert Bradshaw <rober...@math.washington.edu> wrote: > ... > Sorry, I forgot to mention that it must be declared as "cdef public > object __doc__". Otherwise it doesn't create a Python-visible wrapper, > so you're still (from Python) accessing the class-level __doc__.
So, is there a difference between "cpdef" and "cdef public"? I wasn't aware of that. But that's great, and naturally suggests a patch for coerce_binary. While we are at it: Are similar solutions available for the cached_method decorators? Currently, it fails as follows: sage: cython('''from sage.all import cached_method cdef class C: @cached_method def f(self,x): return x ''') Traceback (most recent call last): ... AttributeError: 'method_descriptor' object has no attribute 'func_defaults' Namely, cached_method tries to obtain certain attributes common to python functions from its argument. func_defaults is just one among others. Best regards, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org