@@ -168,6 +168,7 @@ Now, just run `wtfpython` at the command line which will open this collection in
168
168
# ## ▶ First things first!
169
169
170
170
< !-- Example ID : d3d73936- 3cf1 - 4632 - b5ab- 817981338863 -- >
171
+ < !-- read- only -- >
171
172
172
173
For some reasons, " Walrus" operator (`:= ` ) has become a very popular feature in the language. Let' s check it out,
173
174
@@ -220,7 +221,7 @@ SyntaxError: invalid syntax
220
221
221
222
222
223
223
- # ###💡 Explanation
224
+ # ### 💡 Explanation
224
225
225
226
** Quick walrus operator refresher**
226
227
@@ -1455,7 +1456,7 @@ def some_func(val):
1455
1456
1456
1457
1457
1458
### ▶ Yielding from... return!
1458
-
1459
+ <!-- Example ID: 5626d8ef-8802-49c2-adbc-7cda5c550816 --->
1459
1460
1\.
1460
1461
1461
1462
```py
@@ -1634,7 +1635,6 @@ But I thought tuples were immutable...
1634
1635
1635
1636
### ▶ The disappearing variable from outer scope
1636
1637
<!-- Example ID: 7f1e71b6-cb3e-44fb-aa47-87ef1b7decc8 --->
1637
- <!-- version-specific: True -->
1638
1638
1639
1639
```py
1640
1640
e = 7
@@ -1833,7 +1833,6 @@ a, b = a[b] = {}, 5
1833
1833
1834
1834
### ▶ Modifying a dictionary while iterating over it
1835
1835
<!-- Example ID: b4e5cdfb-c3a8-4112-bd38-e2356d801c41 --->
1836
- <!-- version-specific: True -->
1837
1836
```py
1838
1837
x = {0: None}
1839
1838
@@ -1870,7 +1869,7 @@ Yes, it runs for exactly **eight** times and stops.
1870
1869
1871
1870
### ▶ Stubborn `del` operation
1872
1871
<!-- Example ID: 777ed4fd-3a2d-466f-95e7-c4058e61d78e --->
1873
- <!-- read-only: True -->
1872
+ <!-- read-only -->
1874
1873
1875
1874
```py
1876
1875
class SomeClass:
@@ -2065,7 +2064,6 @@ Where did element `3` go from the `numbers` list?
2065
2064
2066
2065
### ▶ Loop variables leaking out!
2067
2066
<!-- Example ID: ccec7bf6-7679-4963-907a-1cd8587be9ea --->
2068
- <!-- version-specific: True -->
2069
2067
1\.
2070
2068
```py
2071
2069
for x in range(7):
@@ -2607,7 +2605,7 @@ def similar_recursive_func(a):
2607
2605
2608
2606
### ▶ Wild imports
2609
2607
<!-- Example ID: 83deb561-bd55-4461-bb5e-77dd7f411e1c --->
2610
- <!-- read-only: True -->
2608
+ <!-- read-only -->
2611
2609
2612
2610
```py
2613
2611
# File: module.py
@@ -2725,7 +2723,7 @@ if noon_time:
2725
2723
2726
2724
**Output (< 3.5):**
2727
2725
2728
- ```sh
2726
+ ```py
2729
2727
('Time at noon is', datetime.time(12, 0))
2730
2728
```
2731
2729
The midnight time is not printed.
@@ -2763,7 +2761,6 @@ Sshh.. It's a super secret.
2763
2761
2764
2762
### ▶ `goto`, but why?
2765
2763
<!-- Example ID: 2aff961e-7fa5-4986-a18a-9e5894bd89fe --->
2766
- <!-- version-specific: True -->
2767
2764
2768
2765
```py
2769
2766
from goto import goto, label
0 commit comments