From 06d12064d0ccb1477fadf1d62492a493fb2fb947 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 12 Oct 2021 21:45:24 -0400 Subject: OptionOverrideProxy: Make it immutable to avoid copies It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it. --- mesonbuild/compilers/compilers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 7c0a2ec..17c9f36 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -32,7 +32,7 @@ from ..arglist import CompilerArgs if T.TYPE_CHECKING: from ..build import BuildTarget - from ..coredata import KeyedOptionDictType + from ..coredata import MutableKeyedOptionDictType, KeyedOptionDictType from ..envconfig import MachineInfo from ..environment import Environment from ..linkers import DynamicLinker, RSPFileSyntax @@ -618,7 +618,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): """ return [] - def get_options(self) -> 'KeyedOptionDictType': + def get_options(self) -> 'MutableKeyedOptionDictType': return {} def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: -- cgit v1.1