Repository navigation
Conversation
90232a1 to
a89c11b
Compare
a89c11b to
bec6f10
Compare
|
Thank you for your interest in contributing to Python. This is a community-driven project, and we want it to be a welcoming place to learn and collaborate. Contributors are responsible for reviewing and understanding what they submit, checking its claims, and being able to explain changes in their own words. This helps reviewers focus on the contribution and leaves more time to support other contributors. We believe this contribution does not meet our guidelines for using AI tools, so we're closing it. If you think we've misunderstood your contribution, please let us know. You're welcome to explain your approach or ask questions about the guidelines. Please read our guidelines for using AI tools. |
|
There are clearly unrelated changes or wrong decisions made by the AI for this patch. Please avoid submitting patches in sensitive-like areas that you do not well-understand. In addition, many comments were changed without good reasons. |
Fixes #162572.
When a custom metaclass uses the default type attribute setter, assigning
__module__clears stale__firstlineno__metadata. The implementation preserves metaclass descriptor dispatch, preflights comparisons that may execute user code, removes the exact metadata key only after the module write succeeds, and invalidates type caches repopulated during that write.Validation:
./python.exe -m test -j2(52,595 tests run; no failures; expected platform/resource skips)./python.exe -m test -j2 test_descr test_capi test_inspect(2,199 tests; all three test files passed)make patchcheckAI disclosure: AI assistance was used to prepare this PR.
__module__doesn't remove__firstlineno__when the class has a custom metaclass #162572