Don't expose Python 3 dicts to innocent, unsuspecting Python 2 code.

This commit is contained in:
Itamar Turner-Trauring 2020-07-28 11:23:40 -04:00
parent 9ca1fdef81
commit e954314fe5

@ -10,7 +10,10 @@ from __future__ import unicode_literals
from future.utils import PY2
if PY2:
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, int, list, object, range, str, max, min # noqa: F401
# IMPORTANT: We deliberately don't import dict. The issue is that we're
# subclassing dict, so we'd end up exposing Python 3 dict APIs to lots of
# code that doesn't support it.
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, int, list, object, range, str, max, min # noqa: F401
class DictOfSets(dict):