Skip to content

Commit 1ec3c5e

Browse files
committed
Dictionary modification: Add python versions in the output
Also adds a note explaining the reason behind it. Related to satwikkansal#54
1 parent f1c2b68 commit 1ec3c5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ for i in x:
317317
print(i)
318318
```
319319
320-
**Output:**
320+
**Output (Python 2.7- Python 3.5):**
321321
322322
```
323323
0
@@ -336,7 +336,8 @@ Yes, it runs for exactly **eight** times and stops.
336336
337337
* Iteration over a dictionary that you edit at the same time is not supported.
338338
* It runs eight times because that's the point at which the dictionary resizes to hold more keys (we have eight deletion entries, so a resize is needed). This is actually an implementation detail.
339-
* Refer to this StackOverflow [thread](https://stackoverflow.com/questions/44763802/bug-in-python-dict) explaining a similar example.
339+
* How deleted keys are handled and when the resize occurs might be different for different Python implementations.
340+
* For more information, you may refer to this StackOverflow [thread](https://stackoverflow.com/questions/44763802/bug-in-python-dict) explaining a similar example in detail.
340341
341342
---
342343

0 commit comments

Comments
 (0)