You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/builtin/abs.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,27 +20,37 @@ Python abs() built-in function
20
20
21
21
The `abs()` function in Python is a built-in function that returns the absolute value of a number. It can handle integers, floating-point numbers, and even complex numbers (returning their magnitude). This function is useful when you need to ensure a value is positive, regardless of its original sign.
Copy file name to clipboardExpand all lines: docs/builtin/aiter.md
+40-7Lines changed: 40 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,18 +18,51 @@ Python aiter() built-in function
18
18
19
19
## Introduction
20
20
21
-
The `aiter()` function in Python is a built-in function that returns an asynchronous iterator for an asynchronous iterable. This is the asynchronous equivalent of the `iter()` function and is essential when working with asynchronous loops (`async for`). It allows you to iterate over objects that produce values asynchronously.
21
+
The `aiter()` function returns an asynchronous iterator from an asynchronous iterable object. It's the asynchronous equivalent of the `iter()` function.
22
+
23
+
You'll typically use `aiter()` implicitly when using an `async for` loop, but you can call it directly if you need to work with the iterator manually, often in conjunction with `anext()`.
22
24
23
25
## Example
24
26
27
+
Here's an example of an asynchronous iterable. The `async for` loop automatically calls `aiter()` on the `AsyncCounter` object to get an iterator.
0 commit comments