On Thu, Feb 12, 2015 at 11:31 AM, Victor Stinner <[email protected]> wrote:
> 2015-02-12 17:12 GMT+01:00 Andrew Svetlov <[email protected]>: > > I like to have simple markup for coroutines but -1 for using return > > annotation for that. > > Return annotation is for return value description, not for function > itself. > > A coroutine function returns a coroutine object. So the annotation "-> > coroutine" is correct, no? > But then the coroutine object has a return type as well, which needs to be represented somehow. I think it's better to let the "return type" portion of the docs represent the eventual return value of the coroutine. The coroutine aspect of the function is most analogous to staticmethods and classmethods, which are given a special prefix in the docs: https://docs.python.org/3/library/stdtypes.html?highlight=fromkeys#dict.fromkeys Unfortunately it looks like these are built into sphinx so it's not as easy to add a new one (unless I'm missing something), but this seems like a good addition for the next version of sphinx. -Ben > > Victor >
