Skip to content

Commit 53204a1

Browse files
authored
[3.12] GH-121970: Remove pyspecific PyDecoratorMixin patches (GH-129306) (#129310)
(cherry picked from commit 0ef8d47)
1 parent c17d30b commit 53204a1

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

Doc/tools/extensions/pyspecific.py

+1-28
Original file line numberDiff line numberDiff line change
@@ -96,32 +96,6 @@ def run(self):
9696
return [pnode]
9797

9898

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-
12599
class PyCoroutineMixin(object):
126100
def handle_signature(self, sig, signode):
127101
ret = super(PyCoroutineMixin, self).handle_signature(sig, signode)
@@ -360,8 +334,7 @@ def setup(app):
360334
app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command)
361335
app.add_object_type('monitoring-event', 'monitoring-event', '%s (monitoring event)', parse_monitoring_event)
362336
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+
365338
app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)
366339
app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod)
367340
app.add_directive_to_domain('py', 'awaitablefunction', PyAwaitableFunction)

0 commit comments

Comments
 (0)