pybind / pybind/pybind11-stubgen
Ignore private attributes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 361
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Attributes with a single leading underscore are considered private, not type info should be generated (by default).
Also see https://mypy.readthedocs.io/en/stable/stubgen.html#cmdoption-stubgen-include-private
The following fragment in AttributeStubsGenerator.to_lines seems to do the job:
def to_lines(self): # type: () -> List[str]
if re.match(r"^_[^_](.*[^_])?$", self.name):
pass
...
Contributor guide
No contributing guide indexed for this repository
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 at AttributeStubsGenerator.to_lines, the entry point named in the issue, and inspect how attribute names are converted to stub lines. Verify that single-leading-underscore attributes are omitted by default while the documented include-private behavior remains available. Done means generated stubs no longer include private attributes unless explicitly requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100