Skip to content

Commit d940e63

Browse files
committed
Instead of subclassing dict, make Deprecated a mix-in.
1 parent ed33213 commit d940e63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

importlib_metadata/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ def flake8_bypass(func):
197197
return func if not is_flake8 else lambda: None
198198

199199

200-
class DeprecatedDict(dict):
200+
class Deprecated:
201201
"""
202-
Compatibility wrapper around dict to indicate that
203-
Mapping behavior is deprecated.
202+
Compatibility add-in for mapping to indicate that
203+
mapping behavior is deprecated.
204204
205205
>>> recwarn = getfixture('recwarn')
206+
>>> class DeprecatedDict(Deprecated, dict): pass
206207
>>> dd = DeprecatedDict(foo='bar')
207208
>>> dd.get('baz', None)
208209
>>> dd['foo']

0 commit comments

Comments
 (0)