-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update xml from 3.13.7 #6100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update xml from 3.13.7 #6100
Conversation
WalkthroughReplaces the module header block comment with a Rust doc comment and introduces a new Python-facing attribute by adding Changes
Sequence Diagram(s)sequenceDiagram
participant Py as Python code
participant Mod as _pyexpat module
participant Const as VERSION_INFO
Py->>Mod: access attribute `version_info`
Mod->>Const: read constant (module-level)
Const-->>Mod: (2, 7, 1)
Mod-->>Py: return (2, 7, 1)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: .coderabbit.yml 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
stdlib/src/pyexpat.rs (2)
1-1: Use inner module doc comments (//!) at the crate/module rootAt the top of a module/file, prefer
//!so the doc attaches to the module itself rather than the next item.-/// Pyexpat builtin module +//! Pyexpat builtin module
42-49: Expose version tuple efficiently; dropPyIntdependencyImplementation is correct. You can simplify by using
vm.ctx.new_int(...)to avoid importingPyIntand the extrainto_pyobjectconversions.- #[pyattr] - pub fn version_info(vm: &VirtualMachine) -> PyTupleRef { - vm.ctx.new_tuple(vec![ - PyInt::from(2).into_pyobject(vm), - PyInt::from(7).into_pyobject(vm), - PyInt::from(1).into_pyobject(vm), - ]) - } + #[pyattr] + pub fn version_info(vm: &VirtualMachine) -> PyTupleRef { + vm.ctx.new_tuple(vec![ + vm.ctx.new_int(2).into(), + vm.ctx.new_int(7).into(), + vm.ctx.new_int(1).into(), + ]) + }If you adopt the above, you can also remove
PyIntfrom the imports:- builtins::{PyInt, PyStr, PyStrRef, PyTupleRef, PyType}, + builtins::{PyStr, PyStrRef, PyTupleRef, PyType},
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (13)
Lib/test/test_xml_dom_xmlbuilder.pyis excluded by!Lib/**Lib/test/test_xml_etree.pyis excluded by!Lib/**Lib/test/test_xml_etree_c.pyis excluded by!Lib/**Lib/xml/dom/expatbuilder.pyis excluded by!Lib/**Lib/xml/dom/minidom.pyis excluded by!Lib/**Lib/xml/dom/xmlbuilder.pyis excluded by!Lib/**Lib/xml/etree/ElementInclude.pyis excluded by!Lib/**Lib/xml/etree/ElementPath.pyis excluded by!Lib/**Lib/xml/etree/ElementTree.pyis excluded by!Lib/**Lib/xml/sax/__init__.pyis excluded by!Lib/**Lib/xml/sax/_exceptions.pyis excluded by!Lib/**Lib/xml/sax/expatreader.pyis excluded by!Lib/**Lib/xml/sax/xmlreader.pyis excluded by!Lib/**
📒 Files selected for processing (1)
stdlib/src/pyexpat.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
**/*.rs: Follow the default rustfmt code style (cargo fmtto format)
Always run clippy to lint code (cargo clippy) before completing tasks. Fix any warnings or lints that are introduced by your changes
Follow Rust best practices for error handling and memory management
Use the macro system (pyclass,pymodule,pyfunction, etc.) when implementing Python functionality in Rust
Files:
stdlib/src/pyexpat.rs
🧬 Code Graph Analysis (1)
stdlib/src/pyexpat.rs (2)
vm/src/builtins/str.rs (10)
from(126-128)from(132-134)from(138-140)from(144-146)from(150-152)from(156-158)from(162-164)from(168-170)from(174-176)from(180-182)vm/src/builtins/int.rs (1)
into_pyobject(56-58)
🔇 Additional comments (2)
stdlib/src/pyexpat.rs (2)
32-32: LGTM: Imports expanded appropriately for new attributeAdding
PyIntandPyTupleRefis correct for constructing the tuple inversion_info. No issues spotted.
42-49: Confirm attribute naming parity with CPython’s pyexpat APII ran a repo-wide search for any existing references to
pyexpat.version_info,expat_version_info,expat_version, orEXPAT_VERSIONand found none. Please verify that:
pyexpat.version_infois the intended public name for this 3.13.7 sync- No existing code/tests elsewhere depend on a different attribute name
- If matching CPython’s API is required, consider exporting one or more of the following aliases for compatibility:
pyexpat.expat_versionpyexpat.expat_version_infopyexpat.EXPAT_VERSION
stdlib/src/pyexpat.rs
Outdated
| pub fn version_info(vm: &VirtualMachine) -> PyTupleRef { | ||
| vm.ctx.new_tuple(vec![ | ||
| PyInt::from(2).into_pyobject(vm), | ||
| PyInt::from(7).into_pyobject(vm), | ||
| PyInt::from(1).into_pyobject(vm), | ||
| ]) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pub fn version_info(vm: &VirtualMachine) -> PyTupleRef { | |
| vm.ctx.new_tuple(vec![ | |
| PyInt::from(2).into_pyobject(vm), | |
| PyInt::from(7).into_pyobject(vm), | |
| PyInt::from(1).into_pyobject(vm), | |
| ]) | |
| } | |
| pub fn version_info(_vm: &VirtualMachine) -> (u32, u32, u32) { | |
| (2, 7, 1) | |
| } |
This may work
Co-authored-by: Jeong, YunWon <[email protected]>
Summary by CodeRabbit