Skip to content

add call_bound and call_method_bound#3711

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:call-bound
Jan 3, 2024
Merged

add call_bound and call_method_bound#3711
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:call-bound

Conversation

@davidhewitt
Copy link
Copy Markdown
Member

Adds Py::call_bound and Py::call_method_bound, which take kwargs: Option<&Bound<'_, PyDict>>.

For &PyAny, I decided not to add these new variants as instead the correct change should be to switch to Bound<'_, PyAny>.

Similarly I changed the argument in PyAnyMethods::call and PyAnyMethods::call_method without introducing new variants.

The other functions like call0 don't need changing as they don't take an Option<&PyDict> argument.

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Dec 29, 2023
@davidhewitt
Copy link
Copy Markdown
Member Author

Uff will fixup doctests later, ideally this evening.

@davidhewitt
Copy link
Copy Markdown
Member Author

(This one is ready for review as far as I'm concerned; the doctests look to be passing now 🎉)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jan 3, 2024

CodSpeed Performance Report

Merging #3711 will improve performances by 10.08%

Comparing davidhewitt:call-bound (50e33d8) with main (f2eb121)

🎉 Hooray! pytest-codspeed just leveled up to 2.2.0!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

⚡ 1 improvements
✅ 77 untouched benchmarks

Benchmarks breakdown

Benchmark main davidhewitt:call-bound Change
list_via_extract 303.3 ns 275.6 ns +10.08%

@davidhewitt davidhewitt added this pull request to the merge queue Jan 3, 2024
Merged via the queue into PyO3:main with commit 58746bb Jan 3, 2024
@davidhewitt davidhewitt deleted the call-bound branch January 3, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-skip-changelog Skip checking changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants