1
1
{
2
2
"#!/usr/bin/env python" : {
3
3
"prefix" : " env" ,
4
- "body" : " #!/usr/bin/env python\n $0"
4
+ "body" : " #!/usr/bin/env python\n $0" ,
5
+ "description" : " Adds shebang line for default python interpreter."
5
6
},
6
7
"#!/usr/bin/env python3" : {
7
8
"prefix" : " env3" ,
8
- "body" : " #!/usr/bin/env python3\n $0"
9
+ "body" : " #!/usr/bin/env python3\n $0" ,
10
+ "description" : " Adds shebang line for default python 3 interpreter."
9
11
},
10
12
"# -*- coding=utf-8 -*-" : {
11
13
"prefix" : " enc" ,
12
- "body" : " # -*- coding=utf-8 -*-\n $0"
14
+ "body" : " # -*- coding=utf-8 -*-\n $0" ,
15
+ "description" : " set default python2.x encoding specification to utf-8 as it is mentioned in pep-0263."
13
16
},
14
17
"# coding=utf-8" : {
15
18
"prefix" : " enco" ,
16
- "body" : " # coding=utf-8\n $0"
19
+ "body" : " # coding=utf-8\n $0" ,
20
+ "description" : " set default python3 encoding specification to utf-8, by default this is the encoding for python3.x as it is mentioned in pep-3120."
17
21
},
18
22
"from future import ..." : {
19
23
"prefix" : " fenc" ,
20
24
"body" : [
21
25
" # -*- coding: utf-8 -*-" ,
22
26
" from __future__ import absolute_import, division, print_function, unicode_literals"
23
- ]
27
+ ],
28
+ "description" : " Import future statement definitions for python2.x scripts using utf-8 as encoding."
24
29
},
25
30
"from future import ... v1" : {
26
31
"prefix" : " fenco" ,
27
32
"body" : [
28
33
" # coding: utf-8" ,
29
34
" from __future__ import absolute_import, division, print_function, unicode_literals"
30
- ]
35
+ ],
36
+ "description" : " Import future statement definitions for python3.x scripts using utf-8 as encoding."
31
37
},
32
38
"import" : {
33
39
"prefix" : " im" ,
34
- "body" : " import ${1:package/module}$0"
40
+ "body" : " import ${1:package/module}$0" ,
41
+ "description" : " Import a package or module"
35
42
},
36
43
"from ... import ..." : {
37
44
"prefix" : " fim" ,
38
- "body" : " from ${1:package/module} import ${2:names}$0"
45
+ "body" : " from ${1:package/module} import ${2:names}$0" ,
46
+ "description" : " Import statement that allows individual objects from the module to be imported directly into the caller’s symbol table."
39
47
},
40
48
"New class" : {
41
49
"prefix" : " class" ,
42
- "body" : " class ${1:ClassName}(${2:object}):\n\t\"\"\" ${3:docstring for $1.}\"\"\"\n\t def __init__(self, ${4:arg}):\n\t\t ${5:super($1, self).__init__()}\n\t\t self.arg = arg\n\t\t $0"
50
+ "body" : " class ${1:ClassName}(${2:object}):\n\t\"\"\" ${3:docstring for $1.}\"\"\"\n\t def __init__(self, ${4:arg}):\n\t\t ${5:super($1, self).__init__()}\n\t\t self.arg = arg\n\t\t $0" ,
51
+ "description" : " Code snippet for a class definition."
43
52
},
44
53
"New method" : {
45
54
"prefix" : " defs" ,
46
- "body" : " def ${1:mname}(self, ${2:arg}):\n\t ${3:pass}$0"
55
+ "body" : " def ${1:mname}(self, ${2:arg}):\n\t ${3:pass}$0" ,
56
+ "description" : " Code snippet for a class method definition."
47
57
},
48
58
"New function" : {
49
59
"prefix" : " def" ,
50
- "body" : " def ${1:fname}(${2:arg}):\n\t ${3:pass}$0"
60
+ "body" : " def ${1:fname}(${2:arg}):\n\t ${3:pass}$0" ,
61
+ "description" : " Code snippet for function definition."
51
62
},
52
63
"New froperty" : {
53
64
"prefix" : " property" ,
54
- "body" : " def ${1:foo}():\n doc = \" ${2:The $1 property.}\"\n def fget(self):\n ${3:return self._$1}\n def fset(self, value):\n ${4:self._$1 = value}\n def fdel(self):\n ${5:del self._$1}\n return locals()\n $1 = property(**$1())$0"
65
+ "body" : " def ${1:foo}():\n doc = \" ${2:The $1 property.}\"\n def fget(self):\n ${3:return self._$1}\n def fset(self, value):\n ${4:self._$1 = value}\n def fdel(self):\n ${5:del self._$1}\n return locals()\n $1 = property(**$1())$0" ,
66
+ "description" : " "
55
67
},
56
68
"if" : {
57
69
"prefix" : " if" ,
58
- "body" : " if ${1:condition}:\n\t ${2:pass}$0"
70
+ "body" : " if ${1:condition}:\n\t ${2:pass}$0" ,
71
+ "description" : " Code snippet for the if statement."
59
72
},
60
73
"for" : {
61
74
"prefix" : " for" ,
62
- "body" : " for ${1:value} in ${2:iterable}:\n\t ${3:pass}$0"
75
+ "body" : " for ${1:value} in ${2:iterable}:\n\t ${3:pass}$0" ,
76
+ "description" : " Code snippet to create a for loop structure."
63
77
},
64
78
"while" : {
65
79
"prefix" : " while" ,
66
- "body" : " while ${1:condition}:\n\t ${2:pass}$0"
80
+ "body" : " while ${1:condition}:\n\t ${2:pass}$0" ,
81
+ "description" : " Code snippet to create a while loop structure."
67
82
},
68
83
"try:except:" : {
69
84
"prefix" : " try" ,
70
- "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}$0"
85
+ "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}$0" ,
86
+ "description" : " Code Snippet for a try and except blocks."
71
87
},
72
88
"try:except:else:finally" : {
73
89
"prefix" : " tryef" ,
74
- "body" : " try:\n\t ${1:pass}\n except${2: ${3:Exception} as ${4:e}}:\n\t ${5:raise}\n else:\n\t ${6:pass}\n finally:\n\t ${7:pass}$0"
90
+ "body" : " try:\n\t ${1:pass}\n except${2: ${3:Exception} as ${4:e}}:\n\t ${5:raise}\n else:\n\t ${6:pass}\n finally:\n\t ${7:pass}$0" ,
91
+ "description" : " Code Snippet for a try/except/finally with else statement."
75
92
},
76
93
"try:except:else" : {
77
94
"prefix" : " trye" ,
78
- "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}\n else:\n\t ${5:pass}$0"
95
+ "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}\n else:\n\t ${5:pass}$0" ,
96
+ "description" : " Code Snippet for a try/except with else statement."
79
97
},
80
98
"try:except:finally" : {
81
99
"prefix" : " tryf" ,
82
- "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}\n finally:\n\t ${5:pass}$0"
100
+ "body" : " try:\n\t ${1:pass}\n except ${2:Exception} as ${3:e}:\n\t ${4:raise $3}\n finally:\n\t ${5:pass}$0" ,
101
+ "description" : " Code Snippet for a try/except/finally."
83
102
},
84
103
"self" : {
85
104
"prefix" : " ." ,
86
- "body" : " self.$0"
105
+ "body" : " self.$0" ,
106
+ "description" : " shortend snippet to reference the self property in an object."
87
107
},
88
108
"__magic__" : {
89
109
"prefix" : " __" ,
90
- "body" : " __${1:init}__$0"
110
+ "body" : " __${1:init}__$0" ,
111
+ "description" : " Code snippet to create magic methods."
91
112
},
92
113
"if __name__ == \" __main__\" " : {
93
114
"prefix" : " ifmain" ,
94
- "body" : " if __name__ == \" __main__\" :\n\t ${1:main()}$0"
115
+ "body" : " if __name__ == \" __main__\" :\n\t ${1:main()}$0" ,
116
+ "description" : " Create implicitly all the code at the top level using the __name__ special variable."
95
117
}
96
118
}
0 commit comments