Skip to content

[mypyc] Use emitter.native_function_call() in emit_attr_defaults_func_call#7

Merged
VaggelisD merged 1 commit into
release-1.20from
use-native-function-call-in-defaults-setup
May 20, 2026
Merged

[mypyc] Use emitter.native_function_call() in emit_attr_defaults_func_call#7
VaggelisD merged 1 commit into
release-1.20from
use-native-function-call-in-defaults-setup

Conversation

@georgesittas
Copy link
Copy Markdown
Collaborator

Follow-up cleanup to #4 applying review feedback from python/mypy#21481 (comment).

Replaces the manual get_group_prefix(...) + NATIVE_PREFIX + cname(...) construction in emit_attr_defaults_func_call with the Emitter.native_function_call() wrapper (added upstream in python#21299). The wrapper handles cross-group vs. intra-group prefixing internally and is less error-prone than rebuilding the function name by hand at the call site. Behaviour is unchanged.

Test plan

  • pre-commit run --files mypyc/codegen/emitclass.py — pass
  • pytest mypyc/test/test_run.py -k testIncrementalCrossModuleInheritedAttrDefaults — 3 pass (TestRun / TestRunMultiFile / TestRunSeparate)
  • Full mypyc test suite (1711 passed, 1 skipped, 2 xfailed) on the upstream branch carrying the identical change

@VaggelisD VaggelisD merged commit c5c1000 into release-1.20 May 20, 2026
16 checks passed
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.

2 participants