Skip to content

Conversation

@sum12
Copy link
Contributor

@sum12 sum12 commented Apr 19, 2022

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

relates #3609

@youknowone
Copy link
Member

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
Copy link
Contributor

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
Copy link
Member

I think you already added tests from the CPython, but here is a guideline if you want to know the regular way: https://github.com/RustPython/RustPython/wiki/How-to-update-test-files

Copy link
Member

@youknowone youknowone left a comment

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
Copy link
Member

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

sum12 added 3 commits April 21, 2022 09:48
the caller is expected to make sure that the passed in object does in
fact supports the protocol

relates RustPython#3609
Copy link
Member

@youknowone youknowone left a comment

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 youknowone merged commit f26c0ba into RustPython:main Apr 22, 2022
@youknowone
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants