mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7403 from tk0miya/7355_wrong_signature_cython
Fix #7355: autodoc: a signature of cython-function is not recognized well
This commit is contained in:
commit
1d299d36d6
1
CHANGES
1
CHANGES
@ -31,6 +31,7 @@ Bugs fixed
|
|||||||
* #7301: capital characters are not allowed for node_id
|
* #7301: capital characters are not allowed for node_id
|
||||||
* #7301: epub: duplicated node_ids are generated
|
* #7301: epub: duplicated node_ids are generated
|
||||||
* #6564: html: a width of table was ignored on HTML builder
|
* #6564: html: a width of table was ignored on HTML builder
|
||||||
|
* #7355: autodoc: a signature of cython-function is not recognized well
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -1019,6 +1019,7 @@ class FunctionDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # typ
|
|||||||
if (not inspect.isfunction(self.object) and
|
if (not inspect.isfunction(self.object) and
|
||||||
not inspect.ismethod(self.object) and
|
not inspect.ismethod(self.object) and
|
||||||
not inspect.isbuiltin(self.object) and
|
not inspect.isbuiltin(self.object) and
|
||||||
|
not inspect.is_cython_function_or_method(self.object) and
|
||||||
not inspect.isclass(self.object) and
|
not inspect.isclass(self.object) and
|
||||||
hasattr(self.object, '__call__')):
|
hasattr(self.object, '__call__')):
|
||||||
self.env.app.emit('autodoc-before-process-signature',
|
self.env.app.emit('autodoc-before-process-signature',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# cython: binding=True
|
# cython: binding=True
|
||||||
|
|
||||||
def foo(*args, **kwargs):
|
def foo(x: int, *args, y: str, **kwargs):
|
||||||
"""Docstring."""
|
"""Docstring."""
|
||||||
|
|
||||||
|
|
||||||
|
@ -1641,7 +1641,7 @@ def test_cython():
|
|||||||
' Docstring.',
|
' Docstring.',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'.. py:function:: foo(*args, **kwargs)',
|
'.. py:function:: foo(x: int, *args, y: str, **kwargs)',
|
||||||
' :module: target.cython',
|
' :module: target.cython',
|
||||||
'',
|
'',
|
||||||
' Docstring.',
|
' Docstring.',
|
||||||
|
Loading…
Reference in New Issue
Block a user