Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Xiretza opened this issue Sep 9, 2019 · 2 comments
Open

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

Xiretza opened this issue Sep 9, 2019 · 2 comments

Comments

@Xiretza
Copy link

Xiretza commented Sep 9, 2019

>>> 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
Copy link

Can I work on this issue? @xrmx

@jonnor
Copy link

jonnor commented Aug 25, 2024

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants