summaryrefslogtreecommitdiffstats
path: root/SCons/PathList.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2023-05-01 17:54:48 (GMT)
committerMats Wichmann <mats@linux.com>2023-05-01 18:06:45 (GMT)
commit1a103470a13a83590b3fc06e8779494e2b99751d (patch)
treeab4b5fcdbc2504ff1436387dbe82db2dcedff22b /SCons/PathList.py
parent0ef81fc03600cd275a8e6733aeca26e0db268dad (diff)
downloadSCons-1a103470a13a83590b3fc06e8779494e2b99751d.zip
SCons-1a103470a13a83590b3fc06e8779494e2b99751d.tar.gz
SCons-1a103470a13a83590b3fc06e8779494e2b99751d.tar.bz2
Add some cheap return and parameter annotations
Use: https://github.com/JelleZijlstra/autotyping to add "safe" return annotations. Where a parameter has a default value that is an obvious scalar type (bool, int, str, etc.) add those annotations as well. Also fixed two small bugs that popped up when sanity-checking with mypy. One in FortranCommon, where a return had been previously annotated to be a tuple of Action, which should be ActionBase - Action is the factory function, not the base class. The other was a typo in the error raised in _add_cppdefines - the message was formatted with the value of "define" which should have been "defines". Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/PathList.py')
-rw-r--r--SCons/PathList.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/SCons/PathList.py b/SCons/PathList.py
index a7e666d..dab8b2c 100644
--- a/SCons/PathList.py
+++ b/SCons/PathList.py
@@ -67,7 +67,7 @@ class _PathList:
"""
An actual PathList object.
"""
- def __init__(self, pathlist):
+ def __init__(self, pathlist) -> None:
"""
Initializes a PathList object, canonicalizing the input and
pre-processing it for quicker substitution later.
@@ -113,7 +113,7 @@ class _PathList:
self.pathlist = tuple(pl)
- def __len__(self): return len(self.pathlist)
+ def __len__(self) -> int: return len(self.pathlist)
def __getitem__(self, i): return self.pathlist[i]
@@ -168,7 +168,7 @@ class PathListCache:
cheaply avoid re-parsing both values of CPPPATH by using the
common value from this cache.
"""
- def __init__(self):
+ def __init__(self) -> None:
self._memo = {}
def _PathList_key(self, pathlist):