Conversation
|
Is there something we'd want to conditionally deprecate here? I don't think the corresponding methods on |
|
Yes I think that any associated deprecation would be the same one that deprecates getting GIL Refs in general, if we can find a nice pattern for that. Probably by deprecating |
|
(Or maybe we deprecate |
|
Thanks for the approval! I'll push some coverage and merge 👍 |
97d382f to
42843de
Compare
CodSpeed Performance ReportMerging #3792 will improve performances by 20.41%Comparing 🎉 Hooray!
|
| Benchmark | main |
davidhewitt:bound-pyclass-2 |
Change | |
|---|---|---|---|---|
| ⚡ | not_a_list_via_downcast |
242.8 ns | 215 ns | +12.92% |
| ⚡ | mapping_from_dict |
327.8 ns | 272.2 ns | +20.41% |
| ⚡ | sequence_from_list |
355.6 ns | 300 ns | +18.52% |
Split from #3606
This PR adds new methods to
Bound<T: PyClass>to access the innerTviaPyRef<T>,PyRefMut<T>and&T.These methods are identical to the ones on
Py<T>.Given that we want to remove the GIL Ref
&PyCell<T>, I think it is correct to add these methods toBound<T>as a replacement.