[Async-sig] [ann] sphinxcontrib-trio: make sphinx better at documenting functions/methods, esp. for async/await code

Yury Selivanov yselivanov at gmail.com
Fri May 12 12:23:44 EDT 2017


I like it!

Do you have support for hybrid iterators/context managers:

  async with con.transaction() as tr
  # or
  tr = await con.transaction()

and

  async for row in con.cursor(’SELECT …')
  # or
  cur = await con.cursor(‘SELECT …’)

I.e. if I annotate `con.transaction` with both `:async:` and
`:async-with:`, will it render two signatures?

Yury


On May 12, 2017 at 4:24:22 AM, Nathaniel Smith (njs at pobox.com) wrote:
> Hi all,
>
> I just released a new package, sphinxcontrib-trio:
>
> https://sphinxcontrib-trio.readthedocs.io/
>
> It makes it easier to document many kinds of functions/methods in
> sphinx, including async functions, abstract methods, generators, etc.
>
> I originally wrote it for the trio [1] project, hence the name, but
> don't let that put you off -- there's nothing about it that's specific
> to trio, or even to async/await (except that projects that use
> async/await *really need* an extension like this). Really I think this
> extension ought to be a standard feature of sphinx. But in the mean
> time, it's pretty handy.
>
> -n
>
> [1] https://trio.readthedocs.io
>
> --
> Nathaniel J. Smith -- https://vorpus.org
> _______________________________________________
> Async-sig mailing list
> Async-sig at python.org
> https://mail.python.org/mailman/listinfo/async-sig
> Code of Conduct: https://www.python.org/psf/codeofconduct/
>


More information about the Async-sig mailing list