mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merge 3.4 (asyncio doc)
This commit is contained in:
commit
866ca88f2d
6 changed files with 72 additions and 42 deletions
|
@ -145,6 +145,30 @@ class PyDecoratorMethod(PyDecoratorMixin, PyClassmember):
|
|||
return PyClassmember.run(self)
|
||||
|
||||
|
||||
class PyCoroutineMixin(object):
|
||||
def handle_signature(self, sig, signode):
|
||||
ret = super(PyCoroutineMixin, self).handle_signature(sig, signode)
|
||||
# signode.insert(0, addnodes.desc_addname('coroutine ', 'coroutine '))
|
||||
signode.insert(0, addnodes.desc_annotation('coroutine ', 'coroutine '))
|
||||
return ret
|
||||
|
||||
def needs_arglist(self):
|
||||
return False
|
||||
|
||||
|
||||
class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel):
|
||||
def run(self):
|
||||
# a decorator function is a function after all
|
||||
self.name = 'py:function'
|
||||
return PyModulelevel.run(self)
|
||||
|
||||
|
||||
class PyCoroutineMethod(PyCoroutineMixin, PyClassmember):
|
||||
def run(self):
|
||||
self.name = 'py:method'
|
||||
return PyClassmember.run(self)
|
||||
|
||||
|
||||
# Support for documenting version of removal in deprecations
|
||||
|
||||
class DeprecatedRemoved(Directive):
|
||||
|
@ -347,5 +371,7 @@ def setup(app):
|
|||
app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
|
||||
app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
|
||||
app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
|
||||
app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)
|
||||
app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod)
|
||||
app.add_directive('miscnews', MiscNews)
|
||||
return {'version': '1.0', 'parallel_read_safe': True}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue