3 # --------------------------------------------------------------------
6 from epydoc
import docstringparser
as dsp
8 CYTHON_SIGNATURE_RE
= re
.compile(
9 # Class name (for builtin methods)
10 r
'^\s*((?P<class>\w+)\.)?' +
14 r
'\(((?P<self>(?:self|cls|mcs)),?)?(?P<params>.*)\)' +
15 # The return value (optional)
16 r
'(\s*(->)\s*(?P<return>\w+(?:\s*\w+)))?' +
20 parse_signature
= dsp
.parse_function_signature
22 def parse_function_signature(func_doc
, doc_source
,
23 docformat
, parse_errors
):
24 PYTHON_SIGNATURE_RE
= dsp
._SIGNATURE
_RE
25 assert PYTHON_SIGNATURE_RE
is not CYTHON_SIGNATURE_RE
27 dsp
._SIGNATURE
_RE
= CYTHON_SIGNATURE_RE
28 found
= parse_signature(func_doc
, doc_source
,
29 docformat
, parse_errors
)
30 dsp
._SIGNATURE
_RE
= PYTHON_SIGNATURE_RE
32 found
= parse_signature(func_doc
, doc_source
,
33 docformat
, parse_errors
)
36 dsp
._SIGNATURE
_RE
= PYTHON_SIGNATURE_RE
38 dsp
.parse_function_signature
= parse_function_signature
40 # --------------------------------------------------------------------
42 from epydoc
.cli
import cli
45 # --------------------------------------------------------------------