Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosummary does not create the description for descriptor attributes #1444

Closed
shimizukawa opened this issue Jan 3, 2015 · 8 comments
Closed

Comments

@shimizukawa
Copy link
Member

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


@shimizukawa
Copy link
Member Author

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

I confirmed the issue by attached project.

@shimizukawa
Copy link
Member Author

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

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

@shimizukawa
Copy link
Member Author

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.

@shimizukawa
Copy link
Member Author

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

Thanks! I'll take a look soon.

@shimizukawa
Copy link
Member Author

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.

@shimizukawa
Copy link
Member Author

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

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

@shimizukawa
Copy link
Member Author

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

Thanks for your confirmation!

@shimizukawa
Copy link
Member Author

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

→ <<cset 8f69e25>>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant