diff mercurial/store.py @ 52692:45dc0f874b8c

typing: lock in the type annotations that were lost with the pyupgrade changes For some reason, these reverted from a specific type to something less useful after the changes that culminated in 70a75d379daf. (e.g. the `remotefilectx` method went from `Generator[remotefilectx, Any, None]` to `Generator[nothing, Any, None]`.) The previous typing for `merge.filemap` was `Generator[Tuple[Any, Tuple[Any, Any, Any]], Any, None]`, and decayed to `Generator[nothing, Any, None]`. I don't feel like unravelling the specific types here, so restore the equivalent of that.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 12 Jan 2025 21:35:30 -0500
parents 4cb75772818d
children
line wrap: on
line diff
--- a/mercurial/store.py	Mon Jan 06 20:02:17 2025 -0500
+++ b/mercurial/store.py	Sun Jan 12 21:35:30 2025 -0500
@@ -16,6 +16,7 @@
 
 from typing import (
     Generator,
+    Iterator,
     List,
     Optional,
 )
@@ -116,7 +117,7 @@
     )
 
 
-def _reserved():
+def _reserved() -> Iterator[int]:
     """characters that are problematic for filesystems
 
     * ascii escapes (0..31)