@@ -96,32 +96,6 @@ def run(self):
96
96
return [pnode ]
97
97
98
98
99
- # Support for documenting decorators
100
-
101
- class PyDecoratorMixin (object ):
102
- def handle_signature (self , sig , signode ):
103
- ret = super (PyDecoratorMixin , self ).handle_signature (sig , signode )
104
- signode .insert (0 , addnodes .desc_addname ('@' , '@' ))
105
- return ret
106
-
107
- def needs_arglist (self ):
108
- return False
109
-
110
-
111
- class PyDecoratorFunction (PyDecoratorMixin , PyFunction ):
112
- def run (self ):
113
- # a decorator function is a function after all
114
- self .name = 'py:function'
115
- return PyFunction .run (self )
116
-
117
-
118
- # TODO: Use sphinx.domains.python.PyDecoratorMethod when possible
119
- class PyDecoratorMethod (PyDecoratorMixin , PyMethod ):
120
- def run (self ):
121
- self .name = 'py:method'
122
- return PyMethod .run (self )
123
-
124
-
125
99
class PyCoroutineMixin (object ):
126
100
def handle_signature (self , sig , signode ):
127
101
ret = super (PyCoroutineMixin , self ).handle_signature (sig , signode )
@@ -360,8 +334,7 @@ def setup(app):
360
334
app .add_object_type ('pdbcommand' , 'pdbcmd' , '%s (pdb command)' , parse_pdb_command )
361
335
app .add_object_type ('monitoring-event' , 'monitoring-event' , '%s (monitoring event)' , parse_monitoring_event )
362
336
app .add_object_type ('2to3fixer' , '2to3fixer' , '%s (2to3 fixer)' )
363
- app .add_directive_to_domain ('py' , 'decorator' , PyDecoratorFunction )
364
- app .add_directive_to_domain ('py' , 'decoratormethod' , PyDecoratorMethod )
337
+
365
338
app .add_directive_to_domain ('py' , 'coroutinefunction' , PyCoroutineFunction )
366
339
app .add_directive_to_domain ('py' , 'coroutinemethod' , PyCoroutineMethod )
367
340
app .add_directive_to_domain ('py' , 'awaitablefunction' , PyAwaitableFunction )
0 commit comments