-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fix derive of PySequenceProtocol
trait
#423
Conversation
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
=========================================
- Coverage 87.85% 87.6% -0.26%
=========================================
Files 62 62
Lines 3285 3331 +46
=========================================
+ Hits 2886 2918 +32
- Misses 399 413 +14
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
=========================================
- Coverage 87.85% 87.6% -0.26%
=========================================
Files 62 62
Lines 3285 3331 +46
=========================================
+ Hits 2886 2918 +32
- Misses 399 413 +14
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks good to me
Rebased on latest |
As shown in #421, implementing
PySequenceProtocol
is not possible inv0.6.0
because the custom derive macro shuffles the argument types. This PR fixes the method types, and adds some tests to check aPySequenceProtocol
implementor compiles as intended.TODO:
__getitem__
,__setitem__
,__delitem__
,__repeat__
,__concat__
__inplace_concat__
and__inplace_repeat__
: it should be something likePyResult<&'mut Self>
orPyResult<PyMutRef<Self>>
since these methods do not have ownership over the Rust struct.