sphinxcontrib-asyncio icon indicating copy to clipboard operation
sphinxcontrib-asyncio copied to clipboard

autodoc + classmethod coroutines do not play well together

Open ewjoachim opened this issue 5 years ago • 1 comments
trafficstars

Here's my code:

class Test:
    @classmethod
    def a(cls):
        """yay"""
        pass

    @classmethod
    async def b(cls):
        """yay"""
        pass

    async def c(self):
        """yay"""
        pass

    def d(self):
        """yay"""
        pass

My doc:

.. autoclass:: module.Test
    :members: a, b, c, d

Here's the generated rst:

.. py:class:: Test
   :module: procrastinate.aiopg_connector

   
   .. py:classmethod:: Test.a()
      :module: procrastinate.aiopg_connector
   
      yay
      
   
   .. py:comethod:: Test.b()
      :module: procrastinate.aiopg_connector
   
      yay
      
   
   .. py:comethod:: Test.c()
      :module: procrastinate.aiopg_connector
   
      yay
      
   
   .. py:method:: Test.d()
      :module: procrastinate.aiopg_connector
   
      yay
      

Here's the output: Screenshot from 2020-02-21 14-59-04

As you can see, b fails to be shown as an async class method.

ewjoachim avatar Feb 21 '20 14:02 ewjoachim

(For completeness, I've tried without sphinxcontrib-asyncio and there's the same issue but in reverse: methods appears as classmethod but not async)

ewjoachim avatar Feb 21 '20 14:02 ewjoachim