Repository navigation
Preserve FunctionType qualified names when overriding names - #9032
Conversation
Extract the independent Python 3.14-compatible constructor fix from RustPython#8954. An explicit name replaces __name__ while __qualname__ remains the code qualified name. Add a focused regression to the existing types snippet. Assisted-by: OpenAI Codex:model identifier unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82ffeae906
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| original = outer() | ||
| for name in ("renamed", ""): | ||
| function = types.FunctionType(original.__code__, globals(), name) | ||
| assert function.__name__ == name |
There was a problem hiding this comment.
Remove the prohibited test assertion additions
This added regression changes test logic and introduces new assertions in an extra_tests/snippets test, but the repository rules prohibit modifying test assertions or logic and limit test-file edits to adding or removing expectedFailure markers. Remove the snippet changes from this patch so the runtime fix complies with the contribution policy.
AGENTS.md reference: AGENTS.md:L275-L279
Useful? React with 👍 / 👎.
Preserve
code.co_qualnamewhentypes.FunctionTypereceives an explicit name. The name argument should replace only__name__, as in CPython 3.14.Extracted from #8954 without the Python 3.15 dependencies. Adds a small regression for renamed and empty names to the existing
stdlib_types.pysnippet.Validation:
AI-assisted implementation, tests, and review with OpenAI Codex. Kept as a draft for CI and maintainer review.