# HG changeset patch # User Matt Harbison # Date 2024-07-19 00:16:31 # Node ID f841de63a5aa9996c71a5a12cb2e81c2db8845b9 # Parent f3b34386d3e07ccedd11e585e7053ca7a359546d typing: add type hints to `i18n._msgcache` Since 10db46e128d4, pytype stopped inferring that the key is bytes. diff --git a/mercurial/i18n.py b/mercurial/i18n.py --- a/mercurial/i18n.py +++ b/mercurial/i18n.py @@ -12,6 +12,7 @@ import os import sys from typing import ( + Dict, List, ) @@ -61,7 +62,9 @@ except AttributeError: _ugettext = t.gettext -_msgcache = {} # encoding: {message: translation} +_msgcache: Dict[ + bytes, Dict[bytes, bytes] +] = {} # encoding: {message: translation} def gettext(message: bytes) -> bytes: