From e8a85fa8a2cdbbcd5dcefd9152be67e4416338ca Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 15 Aug 2021 11:08:26 -0400 Subject: various python neatness cleanups All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles. --- mesonbuild/interpreter/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/interpreter/compiler.py') diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py index 70a2d18..e595daf 100644 --- a/mesonbuild/interpreter/compiler.py +++ b/mesonbuild/interpreter/compiler.py @@ -574,7 +574,7 @@ class CompilerHolder(ObjectHolder['Compiler']): KwargInfo('static', (bool, NoneType), since='0.51.0'), KwargInfo('disabler', bool, default=False, since='0.49.0'), KwargInfo('dirs', ContainerTypeInfo(list, str), listify=True, default=[]), - *[k.evolve(name=f'header_{k.name}') for k in _HEADER_KWS] + *(k.evolve(name=f'header_{k.name}') for k in _HEADER_KWS) ) def find_library_method(self, args: T.Tuple[str], kwargs: 'FindLibraryKW') -> 'dependencies.ExternalLibrary': # TODO add dependencies support? -- cgit v1.1