1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-25 04:24:23 +01:00

Dictionary modification: Add python versions in the output

Also adds a note explaining the reason behind it.

Related to https://github.com/satwikkansal/wtfpython/issues/54
This commit is contained in:
Satwik Kansal 2018-01-11 15:16:54 +05:30
parent f1c2b68d32
commit 1ec3c5e5e9

5
README.md vendored
View File

@ -317,7 +317,7 @@ for i in x:
print(i)
```
**Output:**
**Output (Python 2.7- Python 3.5):**
```
0
@ -336,7 +336,8 @@ Yes, it runs for exactly **eight** times and stops.
* Iteration over a dictionary that you edit at the same time is not supported.
* 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.
* Refer to this StackOverflow [thread](https://stackoverflow.com/questions/44763802/bug-in-python-dict) explaining a similar example.
* How deleted keys are handled and when the resize occurs might be different for different Python implementations.
* 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.
---