diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2024-08-29 10:22:53 -0700 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-05 17:45:38 +0200 |
| commit | fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c (patch) | |
| tree | fe25957a1db43513a0b61183d431b498dea40013 /mesonbuild/compilers/compilers.py | |
| parent | f0a6ba380989c68ecc5af61087157557b329f808 (diff) | |
| download | meson-fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c.tar.gz | |
compilers: remove Compiler.create_option
This saves a *tiny* bit of typing, but at the cost of requiring either
the current solution of throwing up our hands and saying "typing is too
hard, better to have bugs!" or an extensive amount of `TypedDict`s,
`overloads`, and a very new version of mypy. Let's get our type safety
back, even if it means writing a little bit more code.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 011dacfb7..12bcd1e4c 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -588,8 +588,8 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): """ return [] - def create_option(self, option_type: T.Type[UserOptionType], option_key: OptionKey, *args: T.Any, **kwargs: T.Any) -> T.Tuple[OptionKey, UserOptionType]: - return option_key, option_type(f'{self.language}_{option_key.name}', *args, **kwargs) + def make_option_name(self, key: OptionKey) -> str: + return f'{self.language}_{key.name}' @staticmethod def update_options(options: MutableKeyedOptionDictType, *args: T.Tuple[OptionKey, UserOptionType]) -> MutableKeyedOptionDictType: |
