-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support name mangling #16715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tyralla
wants to merge
40
commits into
python:master
Choose a base branch
from
tyralla:feature/name_mangling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support name mangling #16715
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
d93ee65
suggest attributes of anchestors
tyralla 5695d25
add a note to `is_private`
tyralla c54fa1f
handle enum.__member
tyralla d56c4af
implement and apply `NameMangler`
tyralla 35b228e
fix `testSelfTypeReallyTrickyExample`
tyralla b41f095
fix stubtest `test_name_mangling`
tyralla 6530bf1
add name mangling test cases
tyralla 8016d33
use `/` instead of `__` to mark positional-only method parameters
tyralla cf554fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b00ea24
improve auto fix
tyralla a6eb9e4
first hacky step/suggestion for introducing a flag to avoid method pa…
tyralla bacd994
mangle strings in __slots__
tyralla 1c3cba7
different annotation handling when using `from __future__ import anno…
tyralla 89bd158
improve visit_ClassDef
tyralla 8f5f187
improve visit_FunctionDef
tyralla 2bd7626
refactor visit_FunctionDef and visit_AsyncFunctionDef
tyralla 77513a6
different return type annotation handling when using `from __future__…
tyralla 74b46c2
fix
tyralla 9a96ff9
support decorators
tyralla 29f186c
fix
tyralla 292890a
Add TypeVar tests
tyralla e6904d8
for testing: do not mangle annotations when defined in stub files
tyralla cfaddb3
refactor
tyralla a1eb0dd
remove method `is_private` by mangling "__mypy-replace" and "__mypy-p…
tyralla b744349
fix
tyralla 9892dc2
add missing [builtins fixtures/tuple.pyi]
tyralla aec6a87
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d8c7c3e
after rebasing: adjust `infer_variance` to mangled `__mypy-replace` m…
tyralla a04ca0a
fix format
tyralla fd68e7b
add function `maybe_mangled` mainly for fixing the handling of "priva…
tyralla b2a63ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8e8c129
add the module path to the mangled name of an internal dataclass symbol
tyralla 4a01786
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 384b0ee
add the module path to the mangled name of an internal dataclass symbol
tyralla 44a9e32
add the module path to the mangled name of an internal dataclass symbol
tyralla 2fa302b
Merge branch 'master' into feature/name_mangling
tyralla 0acbd5a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 89d11a6
remove `_MANGLE_ARGS` -> never mangle parameter names
tyralla eb92319
move the new test cases from `check-classes.test` to `check-mangling.…
tyralla ec4409b
do not mangle TypedDict keywords
tyralla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also move
'__mypy-'
prefix to a constant somewhereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, defining a constant or a general function for filtering
mypy-
is something we should definitely do (if the general approach of this PR seems acceptable). However, the commit suggestion would not work with the current state of this PR because thedataclasses
plugin now mangles__mypy-replace
and__mypy-post_init
.