From: Vladimír Vondruš Date: Wed, 4 Sep 2019 18:21:43 +0000 (+0200) Subject: documentation/python: don't be so enthusiastic with pybind sig matching. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=fdef68bb0cd686df277b0e2ec754bc5d52562813;p=blog.git documentation/python: don't be so enthusiastic with pybind sig matching. --- diff --git a/documentation/python.py b/documentation/python.py index a1b02b94..b98b7395 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -1247,7 +1247,7 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]: # # Some shitty packages might be setting __doc__ to None (attrs is one of # them), explicitly check for that first. - if state.config['PYBIND11_COMPATIBILITY'] and entry.object.__doc__ and entry.object.__doc__.startswith(entry.path[-1]): + if state.config['PYBIND11_COMPATIBILITY'] and entry.object.__doc__ and entry.object.__doc__.startswith(entry.path[-1] + '('): funcs = parse_pybind_docstring(state, entry.path, entry.object.__doc__) # The crawl (and object_type()) should have detected the overloadedness # already, so check that we have that consistent diff --git a/documentation/test_python/pybind_signatures/false_positives.html b/documentation/test_python/pybind_signatures/false_positives.html index 1ee37cf9..09aaa0eb 100644 --- a/documentation/test_python/pybind_signatures/false_positives.html +++ b/documentation/test_python/pybind_signatures/false_positives.html @@ -39,7 +39,7 @@
def reset()
-
resets everything
+
resets everything. Shouldn't be picked as a pybind signature.