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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:6bda84f9-ee54-b0a5-a1d0-89876cce54bb |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | DD40:11169F:243E41C:2F7880A:696B17E0 |
| html-safe-nonce | a8d886d5d7ef95db42726f1e621bc363f23a64387b5f168a9eb66977b6e31b04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDQwOjExMTY5RjoyNDNFNDFDOjJGNzg4MEE6Njk2QjE3RTAiLCJ2aXNpdG9yX2lkIjoiNjMwNTUyMjYyOTU0ODM4MjE3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b3def6d04b553f63a1093fd5cd5abdb4441839260590f44fa096f306021ee0f4 |
| hovercard-subject-tag | pull_request:2956808363 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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-cache |
| 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 full-width-p-0 |
| disable-turbo | false |
| 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