Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:19:36+00:00 2026-05-30T02:19:36+00:00

When I use Sphinx autodoc to document a class, the values for the attributes

  • 0

When I use Sphinx autodoc to document a class, the values for the attributes are always reported, (as it says it should here, under #437) but always as “= None”

Attribute = None
    Some Documentation

I include it like

.. autoclass:: core.SomeClass
   :members:

And my code looks like

class SomeClass(object):
    def __init__(self):
        self.attribute = "value" #: Some Documentation

Is there a way to either make the “= None” report the real value, or make it disappear?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:19:38+00:00Added an answer on May 30, 2026 at 2:19 am

    I am pretty sure this has to do with the fact that your attribute is an instance attribute. It does not get a value until the class is instantiated. Sphinx imports modules in order to inspect them, but it does not instantiate any classes.

    So the “real value” is not known by Sphinx, and None is output. I don’t think you can make it go away easily (but I suppose anything is possible if you are prepared to patch the Sphinx source code…). If you don’t like this, you could document attributes in the docstring of the class instead.

    Class attributes that are documented using the same markup scheme (described here) do get their values displayed in the rendered output. But there is no clear indication that makes it easy for the reader to distinguish between class and instance attributes. Maybe Sphinx could be a little more helpful here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Sphinx to document a Python project of mine, but
I am attempting to use Sphinx to document my Python class. I do so
I'm trying to use Sphinx to document a 5,000+ line project in Python. It
I need to create a simple search but I can't afford to use Sphinx.
Trying to use autdoc extension of sphinx but its not working. i kept docs
I'm using the Sphinx autodoc extension to document a module, and I'd like to
I am trying to use the sphinx autodoc extension and specifically the automodule directive
Is it possible to use Sphinx autodoc to generate documentation for my fabfile, from
I want to use sphinx's autodoc-skip-member event to select a portion of the members
use this website a lot but first time posting. My program creates a number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.