Skip to content

autosummary does not create the description for descriptor attributes #1444

Closed

Description

@shimizukawa

For example, I want to document the following:

#!python

# MyModule.py

class D(object):
    """Descriptor class
    """

    def __get__(self, instance, owner):
        return 1

    def __set__(self, instance, value):
        pass

class A(object):
    """My Class
    """

    #: Descriptor attribute
    abc = D()

And I create the following RST file:

#!

.. module:: MyModule

.. autoclass:: A
    :members:

    .. autosummary::

        abc

autosummary creates table with the following description for attribute abc:

int(x=0) -> int or long

But in this case I want to see:

Descriptor attribute


Activity

  1. added this to the 1.2.x milestone on Jan 3, 2015
  2. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-09 23:55:41+00:00

    I confirmed the issue by attached project.

  3. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-09 23:59:11+00:00

    issue1444.patch is a quick hacked patch. Please check the behavior.

  4. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Evgeny Prilepin on 2014-04-10 05:55:16+00:00

    I applied issue1444.patch to current sphinx v1.3a0. Your test project is ok. But on my work project is not working. I get the following error:

    Making output directory...
    Running Sphinx v1.3a0
    loading pickled environment... not yet created
    building [html]: targets for 5 source files that are out of date
    updating environment: 5 added, 0 changed, 0 removed
    reading sources... [ 20%] app_signals
    
    Exception occurred:
      File "C:\Programs\Python27_x86\lib\site-packages\docutils\statemachine.py", line 1158, in __setitem__
        raise TypeError('assigning non-ViewList to ViewList slice')
    TypeError: assigning non-ViewList to ViewList slice
    

    See attached full traceback sphinx-err-s8a91q.log.

  5. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-10 06:14:31+00:00

    Thanks! I'll take a look soon.

  6. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-10 09:33:42+00:00

    2nd quick hack (1 line changed)

    Could you please check a new patch?
    I'm going to test with a little more patterns later.

  7. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Evgeny Prilepin on 2014-04-10 11:42:18+00:00

    Thanks! The latest patch issue1444-2.patch works correctly on my project.

  8. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-10 11:54:08+00:00

    Thanks for your confirmation!

  9. shimizukawa commented on Jan 3, 2015

    @shimizukawa
    MemberAuthor

    From Takayuki Shimizukawa on 2014-04-11 15:27:28+00:00

    → <<cset 8f69e25>>

  10. locked as resolved and limited conversation to collaborators on Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions