micropython / micropython-lib

Core Python libraries ported to MicroPython
Other
2.42k stars 1k forks source link

AttributeError: 'defaultdict' object has no attribute 'items' #350

Open Xiretza opened 5 years ago

Xiretza commented 5 years ago
>>> from collections import defaultdict
>>> dd = defaultdict(list)
>>> dd
<defaultdict object at 2006e7d0>
>>> dd.items()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'defaultdict' object has no attribute 'items'

defaultdict doesn't have an items() method, so iterating over it is a bit of a pain in the neck. Also no __repr__(), but that's not totally necessary I guess.

Rohith295 commented 3 years ago

Can I work on this issue? @xrmx

jonnor commented 2 months ago

This seems to still be the case - no "items()" function in the defaultdict module.

Anyone is welcomed to open merge requests in the MicroPython project :)