Skip to content

Hide dataclass InitVar members - #908

Open
wozhenbang2004 wants to merge 3 commits into
mitmproxy:mainfrom
wozhenbang2004:fix/dataclass-initvars-790
Open

wozhenbang2004 wants to merge 3 commits into
mitmproxy:mainfrom
wozhenbang2004:fix/dataclass-initvars-790

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Fixes #790.

Hide InitVar entries in dataclass member lists and navigation, while keeping the constructor parameters intact. Callable defaults are also hidden. Subclass properties and methods that override an inherited InitVar remain visible, as do overrides that become regular fields.

Validated on Linux with Python 3.14 using uv run tox -e lint, uv run tox -e py -- -vvv --cov-fail-under=100, uv run tox -e old-dependencies, and uv build. The full suite passes with 100% coverage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't show dataclasses.InitVar as a class member

1 participant