#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           |  Work issues:
  upstream. No feedback yet.         |       Commit:
         Branch:                     |  6d2b63ada25df1241cca248d26a4df51e3a5be5b
  u/jdemeyer/ticket/17847            |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Replying to [comment:6 jdemeyer]:
 > 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):
 > }}}

 That's for dynamic classes, hence, it is pure Python, and the embedding in
 docstrings isn't relevant here.

 Details: In the category framework we have all these nested dynamic
 classes which get a name that is formed by the name of a class they will
 be attribute of. Hence:
 {{{
 #!python
 class Modules(Category):
     def __init__(...):
         ...
     class Homset(Homset_generic):
         def __init__(...)
 }}}
 Hence, you have a class `Modules` and you have an attribute
 `Modules.Homset` that itself is a class (nested classes). Now, you will
 find:
 {{{
 sage: Modules.Homset.__name__
 'Modules.Homset'
 }}}

 Hence, you will NOT find the source code of the class by searching the
 name in the source file. But the name does give you a possibility to find
 the code, namely by first searching for the source of the class `Modules`
 in the source file and then searching for the source of the class `Homset`
 in the source of `Modules`.

 It isn't relevant for Cython classes, since there is a metaclass at work
 (and you can't have metaclass for Cython classes). It ''could'' perhaps be
 in a cython file, though.

--
Ticket URL: <http://trac.sagemath.org/ticket/17847#comment:9>
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