| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This looks good, thank you for contributing to the project! I've made a comment on your changes and the CI is failing due to a linting error, but fix that up and this is good to merge.
Sorry, something went wrong.
| #[pymethod(name = "__iter__")] | ||
| fn iter(zelf: PyRef<Self>, _vm: &VirtualMachine) -> PyStringIterator { | ||
| PyStringIterator { | ||
| position: Cell::new(0), |
There was a problem hiding this comment.
I believe you're missing the __reversed__ method somewhere here?
Sorry, something went wrong.
There was a problem hiding this comment.
Actually, I checked it using CPython (3.7.3):
>>> hasattr(str, "__reversed__") False
Should I implement __reversed__ despite this fact or leave it unchanged?
Sorry, something went wrong.
There was a problem hiding this comment.
How is PyStringReverseIterator used then?
Sorry, something went wrong.
There was a problem hiding this comment.
Within reverse:
string = "123456789" reversed_iter = reversed(string)
Sorry, something went wrong.
There was a problem hiding this comment.
Right, but nowhere in your code do you construct a PyStringReverseIterator, so there's no way to actually get one in Python code.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok! I'll fix it in a moment.
Sorry, something went wrong.
|
Thanks for your feedback :) I'll deliver corrections today. |
Sorry, something went wrong.
PySliceableSequence trait methods require Range<usize> as arguments
|
I corrected lint warning and added __reverse__ method - it seems to be an easiest solution. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Hello,
I added iteration support for str.