expose Bound::from_owned_ptr etc#3779
Conversation
CodSpeed Performance ReportMerging #3779 will improve performances by 20.41%Comparing 🎉 Hooray!
|
| Benchmark | main |
davidhewitt:bound-from-ptr |
Change | |
|---|---|---|---|---|
| ⚡ | list_via_downcast |
185 ns | 157.2 ns | +17.67% |
| ⚡ | sequence_from_list |
355.6 ns | 300 ns | +18.52% |
| ⚡ | mapping_from_dict |
327.8 ns | 272.2 ns | +20.41% |
| ⚡ | not_a_list_via_downcast |
242.8 ns | 215 ns | +12.92% |
|
I suppose the one design question here is whether we think the simpler Nicer names maybe, but they then lose the consistency with |
|
I think it makes sense to have these as a complement to the ones on I would also suggest to deprecate the corresponding functions on |
|
Thanks, that's enough support for me to merge forward with these as-is for now 👍
Agreed, let me see if I can throw together something for those quickly now... |
4607b4a to
86f294f
Compare
Actually there's still quite a lot of work to migrate off these internally, for now I've just added bullets to #3684 under a deprecations section. |
Split from #3606
This makes
Bound::from_owned_ptrand variants part of the public API, instead ofpub(crate).This is useful for the occasional use case outside of PyO3 which deals with raw FFI. These APIs also have equivalents with the same names which already exist on
Py<T>, so it seems to me that we might as well have these.