mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.12] GH-121970: Replace custom abstract method directive with the `:abstract:` option (GH-129311) (#130440)
(cherry picked from commit 30e892473e)
This commit is contained in:
parent
59c3eb48f9
commit
35c30608e3
6 changed files with 66 additions and 47 deletions
|
|
@ -109,19 +109,6 @@ class PyAwaitableMethod(PyAwaitableMixin, PyMethod):
|
|||
return PyMethod.run(self)
|
||||
|
||||
|
||||
class PyAbstractMethod(PyMethod):
|
||||
|
||||
def handle_signature(self, sig, signode):
|
||||
ret = super(PyAbstractMethod, self).handle_signature(sig, signode)
|
||||
signode.insert(0, addnodes.desc_annotation('abstractmethod ',
|
||||
'abstractmethod '))
|
||||
return ret
|
||||
|
||||
def run(self):
|
||||
self.name = 'py:method'
|
||||
return PyMethod.run(self)
|
||||
|
||||
|
||||
# Support for building "topic help" for pydoc
|
||||
|
||||
pydoc_topic_labels = [
|
||||
|
|
@ -273,6 +260,5 @@ def setup(app):
|
|||
app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod)
|
||||
app.add_directive_to_domain('py', 'awaitablefunction', PyAwaitableFunction)
|
||||
app.add_directive_to_domain('py', 'awaitablemethod', PyAwaitableMethod)
|
||||
app.add_directive_to_domain('py', 'abstractmethod', PyAbstractMethod)
|
||||
app.connect('env-check-consistency', patch_pairindextypes)
|
||||
return {'version': '1.0', 'parallel_read_safe': True}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue