# HG changeset patch # User Pierre-Yves David # Date 1703086743 -3600 # Node ID 7bd7fcc711f299bf3d69bb2fee3fcc03b14707be # Parent 8b2ea2246a5f790da4ccbdfb56f3e3b5bde53625 pytype: drop the last inline type comment We can't assign type to the "for" variant on the fly, so we type the variable and method used instead. diff -r 8b2ea2246a5f -r 7bd7fcc711f2 mercurial/config.py --- a/mercurial/config.py Wed Dec 20 11:23:09 2023 +0100 +++ b/mercurial/config.py Wed Dec 20 16:39:03 2023 +0100 @@ -9,6 +9,11 @@ import errno import os +from typing import ( + List, + Tuple, +) + from .i18n import _ from . import ( encoding, @@ -107,7 +112,7 @@ def sections(self): return sorted(self._data.keys()) - def items(self, section): + def items(self, section: bytes) -> List[Tuple[bytes, bytes]]: items = self._data.get(section, {}).items() return [(k, v[0]) for (k, v) in items] diff -r 8b2ea2246a5f -r 7bd7fcc711f2 mercurial/subrepoutil.py --- a/mercurial/subrepoutil.py Wed Dec 20 11:23:09 2023 +0100 +++ b/mercurial/subrepoutil.py Wed Dec 20 16:39:03 2023 +0100 @@ -74,7 +74,7 @@ to tuple: (source from .hgsub, revision from .hgsubstate, kind (key in types dict)) """ - p = config.config() + p: config.config = config.config() repo = ctx.repo() def read(f, sections=None, remap=None): @@ -143,7 +143,7 @@ return src state = {} - for path, src in p.items(b''): # type: bytes + for path, src in p.items(b''): kind = b'hg' if src.startswith(b'['): if b']' not in src: