diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-01-15 16:19:35 (GMT) |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-01-15 18:13:47 (GMT) |
commit | 531cbfda04263a234238bf58fb6bfa27f8f12ea7 (patch) | |
tree | 2d5915d1e3edc71de45609cfb371eda134ad189d /SCons/Executor.py | |
parent | 7255c54dcd0626bb10e2595f256ebe6a906d1184 (diff) | |
download | SCons-531cbfda04263a234238bf58fb6bfa27f8f12ea7.zip SCons-531cbfda04263a234238bf58fb6bfa27f8f12ea7.tar.gz SCons-531cbfda04263a234238bf58fb6bfa27f8f12ea7.tar.bz2 |
Implement framework for hinting complex types
• Showcase potential with `ExecutorType`
Diffstat (limited to 'SCons/Executor.py')
-rw-r--r-- | SCons/Executor.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/SCons/Executor.py b/SCons/Executor.py index 02be2c9..1b054b4 100644 --- a/SCons/Executor.py +++ b/SCons/Executor.py @@ -24,6 +24,7 @@ """Execute actions with specific lists of target and source Nodes.""" import collections +from typing import Dict import SCons.Errors import SCons.Memoize @@ -31,6 +32,7 @@ import SCons.Util from SCons.compat import NoSlotsPyPy import SCons.Debug from SCons.Debug import logInstanceCreation +from SCons.Util.sctyping import ExecutorType class Batch: """Remembers exact association between targets @@ -548,12 +550,12 @@ class Executor(metaclass=NoSlotsPyPy): -_batch_executors = {} +_batch_executors: Dict[str, ExecutorType] = {} -def GetBatchExecutor(key): +def GetBatchExecutor(key: str) -> ExecutorType: return _batch_executors[key] -def AddBatchExecutor(key, executor) -> None: +def AddBatchExecutor(key: str, executor: ExecutorType) -> None: assert key not in _batch_executors _batch_executors[key] = executor |