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/minit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/minit.py') diff --git a/mesonbuild/minit.py b/mesonbuild/minit.py index 70815633b..e92358268 100644 --- a/mesonbuild/minit.py +++ b/mesonbuild/minit.py @@ -97,7 +97,7 @@ def autodetect_options(options: 'argparse.Namespace', sample: bool = False) -> N raise SystemExit('No recognizable source files found.\n' 'Run meson init in an empty directory to create a sample project.') options.srcfiles = srcfiles - print("Detected source files: " + ' '.join(map(str, srcfiles))) + print("Detected source files: " + ' '.join(str(s) for s in srcfiles)) options.srcfiles = [Path(f) for f in options.srcfiles] if not options.language: for f in options.srcfiles: -- cgit v1.3