On Nov 29, 2008, at 9:01 AM, Simon King wrote: > Dear Sage supporters, > > sorry if this is the wrong list. > I have some cdefined methods of an extension class. How can I doc-test > them? > > In more detail, having the following method definition of an extension > class MTX, the doc test would fail with an attribute error. > cdef MTX _mulInt_(self, long right) > r""" > EXAMPLES: > sage: from mtx import MTX > sage: M=MTX(some data) > sage: M._mulInt_(4) > expected output > """ > > So, what else can I do? Would cpdef work? But I wouldn't like to make > that method public. > Is it possible to do "cdef MTX M=MTX(some data)" in the example, so > that _mulInt_ was available? > > Searching the Cython manual for "test" didn't provide me with an > answer.
You can't call cdef functions from the Python interpreter. You can write a test function, e.g. "_test_mulint." - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
