Skip to content

Commit

Permalink
Instead of subclassing dict, make Deprecated a mix-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 4, 2021
1 parent ed33213 commit d940e63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ def flake8_bypass(func):
return func if not is_flake8 else lambda: None


class DeprecatedDict(dict):
class Deprecated:
"""
Compatibility wrapper around dict to indicate that
Mapping behavior is deprecated.
Compatibility add-in for mapping to indicate that
mapping behavior is deprecated.
>>> recwarn = getfixture('recwarn')
>>> class DeprecatedDict(Deprecated, dict): pass
>>> dd = DeprecatedDict(foo='bar')
>>> dd.get('baz', None)
>>> dd['foo']
Expand Down

0 comments on commit d940e63

Please sign in to comment.