From d5e899c76808d45854a06a4ba2b006da32480165 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 7 Sep 2022 14:03:41 -0700 Subject: pylint: enable the bad_builtin checker This finds uses of deny-listed functions, which defaults to map and filter. These functions should be replaced by comprehensions in idiomatic python because: 1. comprehensions are more heavily optimized and are often faster 2. They avoid the need for lambdas in some cases, which make them faster 3. you can do the equivalent in one statement rather than two, which is faster 4. They're easier to read 5. if you need a concrete instance (ie, a list) then you don't have to convert the iterator to a list afterwards --- mesonbuild/modules/external_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/modules') diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py index dbbd84f..c3b01c8 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -191,7 +191,7 @@ class ExternalProject(NewExtensionModule): missing.update(missing_vars) out.append(arg) if missing: - var_list = ", ".join(map(repr, sorted(missing))) + var_list = ", ".join(repr(m) for m in sorted(missing)) raise EnvironmentException( f"Variables {var_list} in configure options are missing.") return out -- cgit v1.1