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

2017-05-12 Thread Nathaniel Smith
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

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

2017-05-12 Thread Brett Cannon
So are you going to try to upstream this? ;) On Fri, 12 May 2017 at 01:24 Nathaniel Smith 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, inc

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

2017-05-12 Thread Yury Selivanov
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:` an

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

2017-05-12 Thread Nathaniel Smith
[dropped python-announce from CC list] On Fri, May 12, 2017 at 9:17 AM, Brett Cannon wrote: > So are you going to try to upstream this? ;) Realistically, for me this is a side-project to a side-project, so it may require someone else do the integration work, but: https://github.com/sphinx-doc/s

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

2017-05-12 Thread Nathaniel Smith
[dropped python-announce from CC list] On Fri, May 12, 2017 at 9:23 AM, Yury Selivanov wrote: > 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(’S

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

2017-05-12 Thread Yury Selivanov
On May 12, 2017 at 7:10:52 PM, Nathaniel Smith (n...@pobox.com) wrote: > > - The signatures sphinxcontrib-trio currently renders are > also valid > (though unusual), so how do you think it should decide which one > is > meant? Ideally, IMO, it should render it like this: async with Connection.tra