Skip to content

Commit 96ff869

Browse files
authored
Merge pull request wilfredinni#137 from PmS-crypto/patch-2
added an explanatory code snippet
2 parents 96d4052 + 81b4936 commit 96ff869

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

docs/builtin/breakpoint.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,26 @@ description: This function drops you into the debugger at the call site. Specifi
1515
</base-disclaimer-title>
1616
<base-disclaimer-content>
1717
This function drops you into the debugger at the call site [...].
18+
<br/>
19+
Python breakpoint() calls Python debugger at a given line
1820
</base-disclaimer-content>
21+
1922
</base-disclaimer>
2023

21-
<!-- remove this tag to start editing this page -->
22-
<empty-section />
23-
<!-- remove this tag to start editing this page -->
24+
```
25+
# Create a loop over 5 integers
26+
for i in range(5):
27+
# Stream i to stdout
28+
print(i)
29+
# Create breakpoint at # 3
30+
if i == 3:
31+
breakpoint()
32+
#Output
33+
0
34+
1
35+
2
36+
3
37+
> c:\users\user\path\to\your\project\example.py(24)<module>()
38+
-> for i in range(5):
39+
(Pdb)
40+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy