8000 Support name mangling by tyralla · Pull Request #16715 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

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
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d93ee65
suggest attributes of anchestors
tyralla Dec 29, 2023
5695d25
add a note to `is_private`
tyralla Dec 29, 2023
c54fa1f
handle enum.__member
tyralla Dec 29, 2023
d56c4af
implement and apply `NameMangler`
tyralla Dec 29, 2023
35b228e
fix `testSelfTypeReallyTrickyExample`
tyralla Dec 29, 2023
b41f095
fix stubtest `test_name_mangling`
tyralla Dec 29, 2023
6530bf1
add name mangling test cases
tyralla Dec 29, 2023
8016d33
use `/` instead of `__` to mark positional-only method parameters
tyralla Dec 29, 2023
cf554fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 29, 2023
b00ea24
improve auto fix
tyralla Dec 30, 2023
a6eb9e4
first hacky step/suggestion for introducing a flag to avoid method pa…
tyralla Dec 30, 2023
bacd994
mangle strings in __slots__
tyralla Jan 2, 2024
1c3cba7
different annotation handling when using `from __future__ import anno…
tyralla Jan 2, 2024
89bd158
improve visit_ClassDef
tyralla Jan 2, 2024
8f5f187
improve visit_FunctionDef
tyralla Jan 2, 2024
2bd7626
refactor visit_FunctionDef and visit_AsyncFunctionDef
tyralla Jan 3, 2024
77513a6
different return type annotation handling when using `from __future__…
tyralla Jan 3, 2024
74b46c2
fix
tyralla Jan 3, 2024
9a96ff9
support decorators
tyralla Jan 4, 2024
29f186c
fix
tyralla Jan 4, 2024
292890a
Add TypeVar tests
tyralla Jan 4, 2024
e6904d8
for testing: do not mangle annotations when defined in stub files
tyralla Jan 4, 2024
cfaddb3
refactor
tyralla Jan 4, 2024
a1eb0dd
remove method `is_private` by mangling "__mypy-replace" and "__mypy-p…
tyralla Jan 5, 2024
b744349
fix
tyralla Jan 5, 2024
9892dc2
add missing [builtins fixtures/tuple.pyi]
tyralla Jan 30, 2025
aec6a87
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 30, 2025
d8c7c3e
after rebasing: adjust `infer_variance` to mangled `__mypy-replace` m…
tyralla Jan 31, 2025
a04ca0a
fix format
tyralla Jan 31, 2025
fd68e7b
add function `maybe_mangled` mainly for fixing the handling of "priva…
tyralla Feb 1, 2025
b2a63ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 1, 2025
8e8c129
add the module path to the mangled name of an internal dataclass symbol
tyralla Feb 2, 2025
4a01786
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2025
384b0ee
add the module path to the mangled name of an internal dataclass symbol
tyralla Feb 2, 2025
44a9e32
add the module path to the mangled name of an internal dataclass symbol
tyralla Feb 2, 2025
2fa302b
Merge branch 'master' into feature/name_mangling
tyralla Feb 16, 2025
0acbd5a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 16, 2025
89d11a6
remove `_MANGLE_ARGS` -> never mangle parameter names
tyralla Feb 20, 2025
eb92319
move the new test cases from `check-classes.test` to `check-mangling.…
tyralla Feb 21, 2025
ec4409b
do not mangle TypedDict keywords
tyralla Feb 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 1, 2025
commit b2a63ad3e8b42af96d405d0bda3c3f10aba219fa
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
from mypy.types_utils import is_overlapping_none, remove_optional, store_argument_type, strip_type
from mypy.typetraverser import TypeTraverserVisitor
from mypy.typevars import fill_typevars, fill_typevars_with_any, has_no_typevars
from mypy.util import maybe_mangled, is_dunder, is_sunder
from mypy.util import is_dunder, is_sunder, maybe_mangled
from mypy.visitor import NodeVisitor

T = TypeVar("T")
Expand Down
2 changes: 1 addition & 1 deletion mypy/checkmember.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
get_proper_type,
)
from mypy.typetraverser import TypeTraverserVisitor
from mypy.util import maybe_mangled, is_dunder
from mypy.util import is_dunder, maybe_mangled

if TYPE_CHECKING: # import for forward declaration only
import mypy.checker
Expand Down
2 changes: 1 addition & 1 deletion mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import mypy.strconv
from mypy.options import Options
from mypy.util import maybe_mangled, is_dunder, is_typeshed_file, short_type
from mypy.util import is_dunder, is_typeshed_file, maybe_mangled, short_type
from mypy.visitor import ExpressionVisitor, NodeVisitor, StatementVisitor

if TYPE_CHECKING:
Expand Down
9 changes: 8 additions & 1 deletion mypy/semanal.py
74E5
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,14 @@
)
from mypy.types_utils import is_invalid_recursive_alias, store_argument_type
from mypy.typevars import fill_typevars
from mypy.util import correct_relative_import, maybe_mangled, is_dunder, module_prefix, unmangle, unnamed_function
from mypy.util import (
correct_relative_import,
is_dunder,
maybe_mangled,
module_prefix,
unmangle,
unnamed_function,
)
from mypy.visitor import NodeVisitor

T = TypeVar("T")
Expand Down
Loading
0