◐ Shell
clean mode source ↗

implement aiter by sum12 · Pull Request #3646 · RustPython/RustPython

@sum12

the caller is expected to make sure that the passed in object does in
fact supports the protocol

relates #3609

@youknowone

Will you add a simple test if it actually calls __aiter__ from the object?
When possible, we prefer to add tests from CPython's test, but if not possible.
Otherwise, adding a file to extra_tests/snipepts will be enough.
Then our CI will ensure their behavior is same in both CPython and RustPython.

@fanninpm

Will you add a simple test if it actually calls __aiter__ from the object?
When possible, we prefer to add tests from CPython's test, but if not possible.
Otherwise, adding a file to extra_tests/snipepts will be enough.
Then our CI will ensure their behavior is same in both CPython and RustPython.

I think we can just update our copy of test_asyncgen.py to the version from CPython 3.10.

@youknowone

youknowone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good for codes. I have one more request for the commit message. For the commit for test update (64cb090), please leave the updated source of the CPython version. That will be very useful for future contributor of the file. Because git log Lib/test/test_asyncgen.py will show how it is changed by the history just by looking for the log.

@youknowone

Because #3647 updated the test file, rebase will be enough

the caller is expected to make sure that the passed in object does in
fact supports the protocol

relates RustPython#3609

youknowone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you!

@youknowone

@sum12 If you want, converting it to use slots would be also an approachable task