#17847: Cython: embed signatures in docstrings
-------------------------------------------------+-------------------------
       Reporter:  jdemeyer                       |        Owner:
           Type:  enhancement                    |       Status:  new
       Priority:  major                          |    Milestone:  sage-6.6
      Component:  cython                         |   Resolution:
       Keywords:                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Reported upstream. No          |  Work issues:
  feedback yet.                                  |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------
Changes (by jdemeyer):

 * branch:  u/jdemeyer/ticket/17847 =>


Comment:

 The attached branch mostly works, but there are still issues in
 `src/sage/misc/sageinspect.py`

 In particular, I need help with navigating this maze:
 {{{
 #!python
 def _sage_getsourcelines_name_with_dot(object):
     r"""
     [...]
     AUTHOR:

     - Simon King (2011-09)
     """
     # First, split the name:
     if '.' in object.__name__:
         splitted_name = object.__name__.split('.')
     elif hasattr(object,'__qualname__'):
         splitted_name = object.__qualname__.split('.')
     else:
         splitted_name = object.__name__
     path = object.__module__.split('.')+splitted_name[:-1]
     name = splitted_name[-1]
     try:
         M = __import__(path.pop(0))
     except ImportError:
         try:
             B = object.__base__
             if B is None:
                 raise AttributeError
         except AttributeError:
             raise IOError("could not get source code")
         return sage_getsourcelines(B)
     # M should just be the top-most module.
     # Hence, normally it is just 'sage'
     try:
         while path:
             M = getattr(M, path.pop(0))
     except AttributeError:
         try:
             B = object.__base__
             if B is None:
                 raise AttributeError
         except AttributeError:
             raise IOError("could not get source code")
         return sage_getsourcelines(B)

     lines, base_lineno = sage_getsourcelines(M)
     [...]
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17847#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to