diff mercurial/templatekw.py @ 51811:460e80488cf0

typing: lock in correct changes from pytype 2023.04.11 -> 2023.06.16 There were a handful of other changes to the pyi files generated when updating pytype locally (and jumping from python 3.8.0 to python 3.10.11), but they were not as clear (e.g. the embedded type in a list changing from `nothing` to `Any` or similar). These looked obviously correct, and agreed with PyCharm's thoughts on the signatures. Oddly, even though pytype starting inferring `obsutil._getfilteredreason()` as returning bytes, it (correctly) complained about the None path when it was typed that way. Instead, raise a ProgrammingError if an unhandled fate is calculated. (Currently, all possibilities are handled, so this isn't reachable unless another fate is added in the future.)
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 20 Aug 2024 18:30:47 -0400
parents 9ff3d5395d6b
children f4733654f144
line wrap: on
line diff
--- a/mercurial/templatekw.py	Tue Aug 20 17:46:17 2024 -0400
+++ b/mercurial/templatekw.py	Tue Aug 20 18:30:47 2024 -0400
@@ -482,7 +482,7 @@
     return showlatesttags(context, mapping, None)
 
 
-def showlatesttags(context, mapping, pattern):
+def showlatesttags(context, mapping, pattern) -> _hybrid:
     """helper method for the latesttag keyword and function"""
     latesttags = getlatesttags(context, mapping, pattern)