Skip to content

fix: avoid Python name mangling in trampoline prefix for underscore-prefixed classes#499

Merged
boxed merged 1 commit intoboxed:mainfrom
tomrussobuilds:fix/trampoline-name-mangling
Apr 16, 2026
Merged

fix: avoid Python name mangling in trampoline prefix for underscore-prefixed classes#499
boxed merged 1 commit intoboxed:mainfrom
tomrussobuilds:fix/trampoline-name-mangling

Conversation

@tomrussobuilds
Copy link
Copy Markdown
Contributor

Use 'mutmut' prefix instead of '{class_name}' to prevent
identifiers starting with '__' inside class bodies, which Python
mangles and causes NameError at import time.

Fixes #498

…refixed classes

Use '_mutmut_' prefix instead of '_{class_name}_' to prevent
identifiers starting with '__' inside class bodies, which Python
mangles and causes NameError at import time.

Fixes boxed#498
@boxed boxed merged commit fcb8a59 into boxed:main Apr 16, 2026
5 checks passed
@boxed
Copy link
Copy Markdown
Owner

boxed commented Apr 16, 2026

Thanks

tomrussobuilds added a commit to tomrussobuilds/orchard-ml that referenced this pull request Apr 17, 2026
Update Known Issue → Resolved Issue in MUTANTS.md. Fix merged in
boxed/mutmut#499 (2026-04-16): trampoline prefix changed to _mutmut_
to avoid Python name mangling on underscore-prefixed classes.
Retain legacy patch command for builds that predate the fix.
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.

NameError: trampoline name mangling breaks classes with leading underscore

2 participants