You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and can be called like usual methods from python. Resolves#356 (comment)
Currently only slf: PyRef is tested.
Another concern is I observed an undesirable segfault when using arg: PyRef<PyBytes> in pymethod(though I'm not sure it's related to this PR
In general for the self type I think it's better if we had a trait (or maybe reuse extract) that is implemented for all three types instead of trying to guess the right method based on the string-representation of the type
kngwyu
changed the title
Allow slf: Py<Self>/PyRef<Self>/PyRefMut<Self> in pymethods
Allow slf: Py<Self>/PyRef<Self> in pymethods
Mar 29, 2019
kngwyu
changed the title
Allow slf: Py<Self>/PyRef<Self> in pymethods
Allow slf: PyRef<Self>/PyRefMut<Self> in pymethods
Mar 29, 2019
Experimentally I introduced a new trait named FromPyPointer, which registers the pointer to GIL pool and returns the reference of it.
If you come up with a better design, please let me know.
I'll have to check if we already have the traits that can do what FromPyPointer does or with we can replace some other code with the new FromPyPointer, but otherwise it's looking good
@konstin
I want this PR move forward.
Though FromPyPointer is not implemented for Py and PyObject, we should fix this after #446.
It remove lots of Py::from_owned_ptr*s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Looks like
and can be called like usual methods from python.
Resolves #356 (comment)
Currently only
slf: PyRefis tested.Another concern is I observed an undesirable segfault when using
arg: PyRef<PyBytes>in pymethod(though I'm not sure it's related to this PR