diff options
author | Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> | 2022-05-25 21:24:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 21:24:01 +0200 |
commit | d8dbac09efd93bb6cacfad7f46f9efde360526dd (patch) | |
tree | dd75cebd62d25f8af744002464e190733d47c76d /doc/data/messages/c | |
parent | 92e55207354b4701f9d1530d8642f2204c8de9c3 (diff) | |
download | pylint-git-d8dbac09efd93bb6cacfad7f46f9efde360526dd.tar.gz |
Added documentation examples for `consider-using-set-comprehension`. (#6698)
Diffstat (limited to 'doc/data/messages/c')
-rw-r--r-- | doc/data/messages/c/consider-using-set-comprehension/bad.py | 3 | ||||
-rw-r--r-- | doc/data/messages/c/consider-using-set-comprehension/good.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/doc/data/messages/c/consider-using-set-comprehension/bad.py b/doc/data/messages/c/consider-using-set-comprehension/bad.py new file mode 100644 index 000000000..657a21162 --- /dev/null +++ b/doc/data/messages/c/consider-using-set-comprehension/bad.py @@ -0,0 +1,3 @@ +NUMBERS = [1, 2, 2, 3, 4, 4] + +UNIQUE_EVEN_NUMBERS = set([number for number in NUMBERS if number % 2 == 0]) # [consider-using-set-comprehension] diff --git a/doc/data/messages/c/consider-using-set-comprehension/good.py b/doc/data/messages/c/consider-using-set-comprehension/good.py new file mode 100644 index 000000000..4914fc2b0 --- /dev/null +++ b/doc/data/messages/c/consider-using-set-comprehension/good.py @@ -0,0 +1,3 @@ +NUMBERS = [1, 2, 2, 3, 4, 4] + +UNIQUE_EVEN_NUMBERS = {number for number in NUMBERS if number % 2 == 0} |