Skip to content

implement PyCallArgs for borrowed types#5013

Merged
davidhewitt merged 3 commits intomainfrom
callargs-borrowed
Mar 28, 2025
Merged

implement PyCallArgs for borrowed types#5013
davidhewitt merged 3 commits intomainfrom
callargs-borrowed

Conversation

@davidhewitt
Copy link
Copy Markdown
Member

This implements PyCallArgs for Borrowed<'_, 'py, PyTuple>, &Bound<'py, PyTuple>, and &Py<PyTuple>.

While these types are rarer, I did hit a case in pydantic-core where I had an existing Py<PyTuple> which I did not want to transfer ownership of, and adding these implementations avoids a needless reference count op.

Comment thread src/call.rs Outdated
@davidhewitt davidhewitt enabled auto-merge March 28, 2025 08:58
@davidhewitt davidhewitt added this pull request to the merge queue Mar 28, 2025
Merged via the queue into main with commit 1b00b0d Mar 28, 2025
47 of 48 checks passed
@davidhewitt davidhewitt deleted the callargs-borrowed branch March 28, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants