Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72dcb2d

Browse files
authored
Added an example code to explain aiter()
1 parent5736e53 commit72dcb2d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

‎docs/builtin/aiter.md‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ description: Return an asynchronous iterator for an asynchronous iterable. Equiv
1414
From the <a target="_blank" href="https://docs.python.org/3/library/functions.html#aiter">Python 3 documentation</a>
1515
</base-disclaimer-title>
1616
<base-disclaimer-content>
17+
<br/>
1718
Return an asynchronous iterator for an asynchronous iterable. Equivalent to calling x.__aiter__().
1819
</base-disclaimer-content>
1920
</base-disclaimer>
2021

21-
<!-- remove this tag to start editing this page-->
22-
<empty-section />
23-
<!-- remove this tag to start editing this page-->
22+
<base-disclaimer>
23+
<base-disclaimer-content>
24+
<br/>
25+
aiter() is an async equivalent of iter(). <br/> Here's an example showing the use of aiter()
26+
</base-disclaimer-content>
27+
</base-disclaimer>
28+
29+
```async def aitersync(iterable):
30+
results = []
31+
async for x in aiter(iterable):
32+
results.append(x)
33+
return iter(results)
34+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp