Skip to content

Inner exceptions are missing #51

@davidselassie

Description

@davidselassie

I have an exception defined as a nested inner class. It ends up being missing from the resulting documentation. Other exceptions and other nested inner classes do appear, though.

class OuterEx(Exception):
    """This exception is in the module.

    This is rendered.
    """
    pass

class ContainingCls:
    """This is the containing class.

    This is rendered.
    """

    class InnerCls:
        """This is an inner regular class.

        This is rendered."""
        pass

    class InnerEx(Exception):
        """This is an inner exception.

        This is missing!
        """
        pass

Resulting RST:

:py:mod:`test_pkg`
==================

.. py:module:: test_pkg

.. autodoc2-docstring:: test_pkg
   :allowtitles:

Package Contents
----------------

Classes
~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`ContainingCls <test_pkg.ContainingCls>`
     - .. autodoc2-docstring:: test_pkg.ContainingCls
          :summary:

API
~~~

.. py:exception:: OuterEx()
   :canonical: test_pkg.OuterEx

   Bases: :py:obj:`Exception`

   .. autodoc2-docstring:: test_pkg.OuterEx

   .. rubric:: Initialization

   .. autodoc2-docstring:: test_pkg.OuterEx.__init__

.. py:class:: ContainingCls
   :canonical: test_pkg.ContainingCls

   .. autodoc2-docstring:: test_pkg.ContainingCls

   .. py:class:: InnerCls
      :canonical: test_pkg.ContainingCls.InnerCls

      .. autodoc2-docstring:: test_pkg.ContainingCls.InnerCls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions