# HG changeset patch # User Matt Harbison # Date 1671232494 18000 # Node ID 464fe8b8f4746dbe6ee759f6c791ca8fd4add07a # Parent 1d1b244a91b603a266aad491b6a8a6b5d978411a typing: add type hints to the platform `cachestat` classes diff -r 1d1b244a91b6 -r 464fe8b8f474 mercurial/posix.py --- a/mercurial/posix.py Fri Dec 16 14:24:02 2022 -0500 +++ b/mercurial/posix.py Fri Dec 16 18:14:54 2022 -0500 @@ -20,6 +20,7 @@ import unicodedata from typing import ( + Any, Iterable, Iterator, List, @@ -672,15 +673,15 @@ class cachestat: - def __init__(self, path): + def __init__(self, path: bytes) -> None: self.stat = os.stat(path) - def cacheable(self): + def cacheable(self) -> bool: return bool(self.stat.st_ino) __hash__ = object.__hash__ - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: try: # Only dev, ino, size, mtime and atime are likely to change. Out # of these, we shouldn't compare atime but should compare the @@ -701,7 +702,7 @@ except AttributeError: return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: return not self == other diff -r 1d1b244a91b6 -r 464fe8b8f474 mercurial/windows.py --- a/mercurial/windows.py Fri Dec 16 14:24:02 2022 -0500 +++ b/mercurial/windows.py Fri Dec 16 18:14:54 2022 -0500 @@ -664,10 +664,10 @@ class cachestat: - def __init__(self, path): + def __init__(self, path: bytes) -> None: pass - def cacheable(self): + def cacheable(self) -> bool: return False