Files
RustPython/crates/derive-impl
Jeong, YunWon bb9ef5d0c2 Infer native calling convention flags from argument metadata (#9005)
`PyMethodDef::new_const`, `PyMethodDef::new_raw_const` and
`Context::new_method_def` add the calling convention (`NOARGS`, `O`,
`FASTCALL`, or `FASTCALL | KEYWORDS`) inferred from the
`FromArgs::PARAMS` of each argument, exposed as `IntoPyNativeFn::ARGS`.
Flags that already contain a calling convention, such as C-API
`ml_flags`, are kept. For `METHOD` and `CLASS` the first argument is the
bound receiver. Raw functions get `FASTCALL | KEYWORDS`.

The derive macros pass only binding flags and no longer infer call flags
from Rust type names. Definitions built without the macros, such as the
`__new__` wrapper and `vm.new_function`, get calling convention flags the
same way.

Assisted-by: Claude Code:claude-opus-5-5
2026-10-08 17:43:30 +09:00
..