Examining a defaultdict adds a key of 0
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 245
- Avg merge
- 13m
- Merged PRs (30d)
- 5
Description
Run pudb on this code:
``` python
import collections
d = collections.defaultdict(set)
print d
print len(d)
```
It will print:
```
defaultdict(, {})
0
```
Now run the code in pudb again, but after d is created, open it in the Variables pane. It will have a key of 0 with an empty set as a value, and when the program is finished running, it will have printed:
```
defaultdict(, {0: set([])})
1
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the supplied Python snippet in pudb and opening the defaultdict in the Variables pane. Trace how the Variables pane examines defaultdict values, then verify that inspecting d does not add key 0 and that its length and printed contents remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100