Repository navigation
Fix self type hint in properties and add type hinted handle and self - #6285
gentlegiantJGC wants to merge 19 commits into
Conversation
|
I ran a review on this. The key finding is the test doesn't actually test the change, and passes on master too. That needs to be fixed. 🤖 AI text below 🤖 The Important
Pre-existing Nits |
|
|
Oh, that's tricky. I'd personally like to get rid of that job someday, and just build both variations into the tests that touch them. So I think if this is smart-holder specific, making only smart holder makes sense. But if you like it running on both, that job isn't going anywhere soon and all cases like this would have to be handled anyway, so keeping this way is fine too. |
The classes can be used as Handle<T> and Object<T> and will be type hinted as T instead of object. This does not change the runtime behaviour.
This did not match py::typing::Handle because it was only looking for py::handle
ffa5c03 to
a2f4b43
Compare
|
Rebased to pick up #6290. |
Description
Some property constructors for classes using
smart_holdertakeselfas ahandlewhich gets converted toobjectin the type hints.This adds a type hinted variant of
handleandobjectthat accept a C++ type which is used as the type hint but are otherwise interchangeable withhandleandobject. This is used to correctly type hint theselfargument indef_read(only|write)#4961 requested a type hinted version of
py::objectSuggested changelog entry: