Skip to content

Commit

Permalink
Override _asdict. Fixes #337.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 13, 2021
1 parent f4f788e commit 7b42ca1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions importlib_metadata/__init__.py
Expand Up @@ -209,6 +209,10 @@ def matches(self, **params):
attrs = (getattr(self, param) for param in params)
return all(map(operator.eq, params.values(), attrs))

def _asdict(self):
# override _asdict, broken by custom __iter__.
return {key: getattr(self, key) for key in self._fields}


class DeprecatedList(list):
"""
Expand Down

0 comments on commit 7b42ca1

Please sign in to comment.