changeset 51717:f841de63a5aa

typing: add type hints to `i18n._msgcache` Since 10db46e128d4, pytype stopped inferring that the key is bytes.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 18 Jul 2024 20:16:31 -0400
parents f3b34386d3e0
children 45828bc3c3d6
files mercurial/i18n.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/i18n.py	Thu Jul 18 19:57:42 2024 -0400
+++ b/mercurial/i18n.py	Thu Jul 18 20:16:31 2024 -0400
@@ -12,6 +12,7 @@
 import sys
 
 from typing import (
+    Dict,
     List,
 )
 
@@ -61,7 +62,9 @@
     _ugettext = t.gettext
 
 
-_msgcache = {}  # encoding: {message: translation}
+_msgcache: Dict[
+    bytes, Dict[bytes, bytes]
+] = {}  # encoding: {message: translation}
 
 
 def gettext(message: bytes) -> bytes: