|
1 | 1 | {
|
2 | 2 | "List comprehension": {
|
3 | 3 | "prefix": "lc",
|
4 |
| - "body": "[${1:value} for ${2:value} in ${3:iterable}]$0", |
| 4 | + "body": "[${3:value} for ${2:value} in ${1:iterable}]$0", |
5 | 5 | "description": "List comprehension for creating a list based on existing lists."
|
6 | 6 | },
|
7 | 7 | "List comprehension if else": {
|
8 | 8 | "prefix": "lcie",
|
9 |
| - "body": "[${1:value} if ${2:condition} else ${3:condition} for ${4:value} in ${5:iterable}]$0", |
| 9 | + "body": "[${3:value} if ${4:condition} else ${5:condition} for ${2:value} in ${1:iterable}]$0", |
10 | 10 | "description": "List comprehension for creating a list based on existing lists, with conditional if-else statement."
|
11 | 11 | },
|
12 | 12 | "List comprehension if filter": {
|
13 | 13 | "prefix": "lci",
|
14 |
| - "body": "[${1:value} for ${2:value} in ${3:iterable} if ${4:condition}$0]", |
| 14 | + "body": "[${3:value} for ${2:value} in ${1:iterable} if ${4:condition}$0]", |
15 | 15 | "description": "List comprehension for creating a list based on existing lists, with conditional if statement."
|
16 | 16 | },
|
17 | 17 | "Dictionary comprehension": {
|
18 | 18 | "prefix": "dc",
|
19 |
| - "body": "{${1:key}: ${2:value} for ${3:key}, ${4:value} in ${5:iterable}}$0", |
| 19 | + "body": "{${4:key}: ${5:value} for ${2:key}, ${3:value} in ${1:iterable}}$0", |
20 | 20 | "description": "Handy and faster way to create dictionaries based on existing dictionaries."
|
21 | 21 | },
|
22 | 22 | "Dictionary comprehension if filter": {
|
23 | 23 | "prefix": "dci",
|
24 |
| - "body": "{${1:key}: ${2:value} for ${3:key}, ${4:value} in ${5:iterable} if ${6:condition}}$0", |
| 24 | + "body": "{${4:key}: ${5:value} for ${2:key}, ${3:value} in ${1:iterable} if ${6:condition}}$0", |
25 | 25 | "description": "Handy and faster way to create dictionaries based on existing dictionaries, with conditional if statement."
|
26 | 26 | },
|
27 | 27 | "Set comprehension": {
|
28 | 28 | "prefix": "sc",
|
29 |
| - "body": "{${1:value} for ${2:value} in ${3:iterable}}$0", |
| 29 | + "body": "{${3:value} for ${2:value} in ${1:iterable}}$0", |
30 | 30 | "description": "Create a set based on existing iterables."
|
31 | 31 | },
|
32 | 32 | "Set Comprehension if filter": {
|
33 | 33 | "prefix": "sci",
|
34 |
| - "body": "{${1:value} for ${2:value} in ${3:iterable} if ${4:condition}}$0", |
| 34 | + "body": "{${3:value} for ${2:value} in ${1:iterable} if ${4:condition}}$0", |
35 | 35 | "description": "Create a set based on existing iterables, with condition if statement."
|
36 | 36 | },
|
37 | 37 | "Generator comprehension": {
|
38 | 38 | "prefix": "gc",
|
39 |
| - "body": "(${1:key} for ${2:value} in ${3:iterable})$0", |
| 39 | + "body": "(${3:key} for ${2:value} in ${1:iterable})$0", |
40 | 40 | "description": "Create a generator based on existing iterables."
|
41 | 41 | },
|
42 | 42 | "Generator comprehension if filter": {
|
43 | 43 | "prefix": "gci",
|
44 |
| - "body": "(${1:key} for ${2:value} in ${3:iterable} if ${4:condition})$0", |
| 44 | + "body": "(${3:key} for ${2:value} in ${1:iterable} if ${4:condition})$0", |
45 | 45 | "description": "Create a generator based on existing iterables, with condition if statement."
|
46 | 46 | }
|
47 | 47 | }
|
0 commit comments