Skip to content

Conversation

@aqshafei
Copy link
Contributor

There were some changes in PyO3 v0.25. A refactor was needed to move from PyO3 0.20 to the latest PyO3 version.
Which let me use the PyO3 maintained async library. See the Issue #2 for the background story.

@aqshafei aqshafei requested review from jacomago and simon-ess May 21, 2025 13:25
@aqshafei aqshafei self-assigned this May 21, 2025
@aqshafei aqshafei added the dependencies Update a dependency with/without refactoring label May 21, 2025
@aqshafei aqshafei linked an issue May 21, 2025 that may be closed by this pull request
let properties = PyDict::new(py);
fn properties(&self) -> PyResult<HashMap<String, String>> {
let mut properties: HashMap<String, String> = HashMap::new();
for (key, value) in &self.0.properties {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird to do a for loop for this, can't we just return something like properties.deep_clone()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how deep/shallow is the clone trait implementation in the Hashmap code. the docs says "Returns a copy of the value."

I've test .clone(), it seem to work fine.

@aqshafei aqshafei merged commit 53aab40 into main May 26, 2025
1 check passed
@aqshafei aqshafei deleted the pyo3-refactoring branch May 26, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Update a dependency with/without refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Python binding library PyO3 from version 0.20.x to 0.25.0

3 participants