QUERY · ISSUE
AttributeError: 'defaultdict' object has no attribute 'items'
>>> 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.
CANDIDATE · ISSUE
no __dict__ attribute in a module object
chipset: ESP32
MicroPython version: 1.12
Traceback:
Traceback (most recent call last):
File "boot.py", line 1, in <module>
File "LEDS/__init__.py", line 134, in <module>
File "LEDS/__init__.py", line 115, in __init__
AttributeError: 'module' object has no attribute '__dict__'
Code to reproduce error:
import sys
TEST_VARIABLE = 'This is a test'
print(sys.modules[__name__].__dict__)
Run the code above in both CPython and MicroPython, you will not get an error when it runs in CPython
Can I work on this issue? @xrmx
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 :)