Skip to content

Commit f702e79

Browse files
committed
Use MappingProxyType for _CROSS_LANGUAGE_HINTS per vstinner review
1 parent 2a2c0d5 commit f702e79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/traceback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ def print(self, *, file=None, chain=True, **kwargs):
16671667
# If is_raw is True, the suggestion is rendered as-is.
16681668
#
16691669
# See https://github.com/python/cpython/issues/146406.
1670-
_CROSS_LANGUAGE_HINTS = {
1670+
_CROSS_LANGUAGE_HINTS = types.MappingProxyType({
16711671
# list -- JavaScript/Ruby equivalents
16721672
(list, "push"): ("append", False),
16731673
(list, "concat"): ("extend", False),
@@ -1687,7 +1687,7 @@ def print(self, *, file=None, chain=True, **kwargs):
16871687
(dict, "entries"): ("items", False),
16881688
(dict, "putAll"): ("update", False),
16891689
(dict, "put"): ("Use d[k] = v.", True),
1690-
}
1690+
})
16911691

16921692

16931693
def _substitution_cost(ch_a, ch_b):

0 commit comments

Comments
 (0)