From bedc636c952f9a484a999c00fac84b4ca179ff5e Mon Sep 17 00:00:00 2001 From: Carlos Montecinos Date: Mon, 31 Oct 2022 13:51:25 -0300 Subject: [PATCH 1/2] fix: breakpoint builtin example format --- docs/builtin/breakpoint.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/builtin/breakpoint.md b/docs/builtin/breakpoint.md index 901ec02d..97504904 100644 --- a/docs/builtin/breakpoint.md +++ b/docs/builtin/breakpoint.md @@ -18,23 +18,24 @@ description: This function drops you into the debugger at the call site. Specifi
Python breakpoint() calls Python debugger at a given line - -``` -# Create a loop over 5 integers -for i in range(5): - # Stream i to stdout - print(i) - # Create breakpoint at # 3 - if i == 3: - breakpoint() -#Output -0 -1 -2 -3 -> c:\users\user\path\to\your\project\example.py(24)() --> for i in range(5): -(Pdb) +## Example + +```python +>>> # Create a loop over 5 integers +>>> for i in range(5): +... # Stream i to stdout +... print(i) +... # Create breakpoint at # 3 +... if i == 3: +... breakpoint() +... +# 0 +# 1 +# 2 +# 3 +# > c:\users\user\path\to\your\project\example.py(24)() +# -> for i in range(5): +# (Pdb) ``` From efe5dc2b28ebda6700fdc6230f9ebaf98be117c9 Mon Sep 17 00:00:00 2001 From: Carlos Montecinos Date: Mon, 31 Oct 2022 13:55:02 -0300 Subject: [PATCH 2/2] fix: aiter builtin example format --- .vscode/settings.json | 1 + docs/builtin/aiter.md | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 31001a09..f814b811 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,7 @@ "cSpell.words": [ "abspath", "aiter", + "aitersync", "Anyconfig", "Arham", "asctime", diff --git a/docs/builtin/aiter.md b/docs/builtin/aiter.md index f907b76a..b77e2966 100644 --- a/docs/builtin/aiter.md +++ b/docs/builtin/aiter.md @@ -14,21 +14,16 @@ description: Return an asynchronous iterator for an asynchronous iterable. Equiv From the Python 3 documentation -
- Return an asynchronous iterator for an asynchronous iterable. Equivalent to calling x.__aiter__(). + Return an asynchronous iterator for an asynchronous iterable. Equivalent to calling x.__aiter__(). aiter() is an async equivalent of iter()
- - -
- aiter() is an async equivalent of iter().
Here's an example showing the use of aiter() -
-
+## Example -```async def aitersync(iterable): - results = [] - async for x in aiter(iterable): - results.append(x) - return iter(results) - ``` +```python +>>> async def aitersync(iterable): +... results = [] +... async for x in aiter(iterable): +... results.append(x) +... return iter(results) +```