Title: Implement minimal builtins.anext() by YashSuthar983 · Pull Request #6226 · RustPython/RustPython · GitHub
Open Graph Title: Implement minimal builtins.anext() by YashSuthar983 · Pull Request #6226 · RustPython/RustPython
X Title: Implement minimal builtins.anext() by YashSuthar983 · Pull Request #6226 · RustPython/RustPython
Description: issue : #3609
Currently passes
import builtins
import asyncio
async def agen():
for i in range(3):
yield i
async def main():
aiter = agen()
val1 = await builtins.anext(aiter)
print("val1:", val1)
val2 = await builtins.anext(aiter)
print("val2:", val2)
val3 = await builtins.anext(aiter, "done")
print("val3:", val3)
asyncio.run(main())
Failed case ,need PyAnextAwaitable
import asyncio
async def simple_test():
async def agen():
yield 1
aiter = agen()
print(f"First value: {await anext(aiter)}")
# EXPECTED: Should return "no more values"
result = await anext(aiter, "no more values")
print(f"Second value: {result}")
if __name__ == "__main__":
asyncio.run(simple_test())
#Cpython
First value: 1
Second value: no more values
#RustPython
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/rustpython /home/yash/test_anext_simple.py`
First value: 1
Traceback (most recent call last):
File "/home/yash/test_anext_simple.py", line 22, in
Open Graph Description: issue : #3609 Currently passes import builtins import asyncio async def agen(): for i in range(3): yield i async def main(): aiter = agen() val1 = await builtins.anext(aiter) ...
X Description: issue : #3609 Currently passes import builtins import asyncio async def agen(): for i in range(3): yield i async def main(): aiter = agen() val1 = await builtins.anext(aiter) ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6226
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6fe5369a-6cc1-dd86-4386-9eafd7a9df56 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 991A:2F3D43:1F75CD:28E2FC:696B6315 |
| html-safe-nonce | 43afdfd13a5cedd8ec3e3ae04a6285d3a66c013d3a5746066ea4515f8f797506 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTFBOjJGM0Q0MzoxRjc1Q0Q6MjhFMkZDOjY5NkI2MzE1IiwidmlzaXRvcl9pZCI6IjQ2NDI0NTkwMDk5MDAzMDcyMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 197d2bd70eaf93ca8a4392764c465077308b38ced79daab2bcb9f953beaa7094 |
| hovercard-subject-tag | pull_request:2956808363 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/6226/files |
| twitter:image | https://avatars.githubusercontent.com/u/183753953?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/183753953?s=400&v=4 |
| og:image:alt | issue : #3609 Currently passes import builtins import asyncio async def agen(): for i in range(3): yield i async def main(): aiter = agen() val1 = await builtins.anext(aiter) ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width