-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
When C/C++ signatures are included in the C modules docstring. It is parsed as an overload.
To Reproduce
This script for examples outputs 2 signatures:
import mypy.stubdoc
sigs = mypy.stubdoc.infer_sig_from_docstring(
"""
addLane(data: MyStruct) -> None
C++: addLane(const MyStruct data) --> void
""",
"addLane",
)
if sigs is not None:
for sig in sigs:
print(sig)Expected Behavior
There should only be one signature in the resulting stub.
Actual Behavior
there are two signatures produced
FunctionSig(name='addLane', args=[ArgSig(name='data', type='MyStruct', default=False)], ret_type='None')
FunctionSig(name='addLane', args=[ArgSig(name='constMyStructdata', type=None, default=False)], ret_type='void')
Your Environment
- stubgen version: 1.13.0
- Python version used: 3.12
I have a pull request to solve this, #17658
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong