stubgen: `--include-private` not effective for C modules
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
--include-private option of stubgen is not effective for C modules.
To Reproduce
Generate a stub for C modules with private members, e.g., by cythonizing:
# foo.pyx
def _foo(): pass
Then run stubgen -m foo to generate a stub.
Expected Behavior
_foo() does not appear in the stub unless --include-private is specified.
Actual Behavior
_foo() always appear in the stub.
Your Environment
- Mypy version used: 0.812
- Mypy command-line flags: n/a
- Mypy configuration options from
mypy.ini(and other config files): n/a - Python version used: 3.7.8
- Operating system and version: Ubuntu 18.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the stubgen entry point and reproduce the issue using the shown foo.pyx C-module example, then compare output from stubgen -m foo with and without --include-private. Done means private members such as _foo() are omitted by default and included only when the option is specified; add or run the relevant stubgen regression test if one is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100