From e113719ecafdde5a1a1534885f8cf2bbc6d2330e Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Sun, 27 Mar 2022 00:29:23 +0100 Subject: [PATCH 1/2] Added example for bad-builtin --- doc/data/messages/b/bad-builtin/bad.py | 2 ++ doc/data/messages/b/bad-builtin/good.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 doc/data/messages/b/bad-builtin/bad.py create mode 100644 doc/data/messages/b/bad-builtin/good.py diff --git a/doc/data/messages/b/bad-builtin/bad.py b/doc/data/messages/b/bad-builtin/bad.py new file mode 100644 index 0000000000..1c60815e59 --- /dev/null +++ b/doc/data/messages/b/bad-builtin/bad.py @@ -0,0 +1,2 @@ +numbers = list(map(lambda x: 2 * x, [1, 2, 3])) # [bad-builtin] +print(numbers) diff --git a/doc/data/messages/b/bad-builtin/good.py b/doc/data/messages/b/bad-builtin/good.py new file mode 100644 index 0000000000..36ae412e21 --- /dev/null +++ b/doc/data/messages/b/bad-builtin/good.py @@ -0,0 +1,2 @@ +numbers = [lambda x: 2 * x, [1, 2, 3]] +print(numbers) From feb2ee4ddbe2aad751b8b137213beff0ce3d34db Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Sun, 27 Mar 2022 21:46:29 +0200 Subject: [PATCH 2/2] Update doc/data/messages/b/bad-builtin/good.py Co-authored-by: Pierre Sassoulas --- doc/data/messages/b/bad-builtin/good.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/b/bad-builtin/good.py b/doc/data/messages/b/bad-builtin/good.py index 36ae412e21..c56dbfbe3c 100644 --- a/doc/data/messages/b/bad-builtin/good.py +++ b/doc/data/messages/b/bad-builtin/good.py @@ -1,2 +1,2 @@ -numbers = [lambda x: 2 * x, [1, 2, 3]] +numbers = [2 * x for x in [1, 2, 3]] print(numbers)