Skip to content

Commit 533dc0b

Browse files
author
Christian Strappazzon
committed
Some improvemets, see changelog
1 parent e76d6c0 commit 533dc0b

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22
All notable changes to the "python-snippets" extension will be documented in this file.
33

4+
## [0.0.8]
5+
- Merge PR #9, #10
6+
- Add "New property", issue #2
7+
48
## [0.0.7]
59
- Merge PR #7
610

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python-snippets",
33
"displayName": "python-snippets",
44
"description": "Python Snippets",
5-
"version": "0.0.7",
5+
"version": "0.0.8",
66
"publisher": "cstrap",
77
"icon": "images/python.png",
88
"engines": {

snippets/base.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"# coding=utf-8": {
1818
"prefix": "enco",
1919
"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."
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."
2121
},
2222
"from future import ...": {
2323
"prefix": "fenc",
@@ -60,6 +60,11 @@
6060
"body": "def ${1:fname}(${2:arg}):\n\t${3:pass}$0",
6161
"description" : "Code snippet for function definition."
6262
},
63+
"New property": {
64+
"prefix": "property",
65+
"body": "@property\ndef ${1:foo}(self):\n \"\"\"${2:The $1 property.}\"\"\"\n ${3:return self._$1}\n@${4:$1}.setter\ndef ${5:$1}(self, value):\n ${6:self._$1} = value",
66+
"description": "New property: get and set via decorator"
67+
},
6368
"New froperty": {
6469
"prefix": "property",
6570
"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",
@@ -103,7 +108,7 @@
103108
"self": {
104109
"prefix": ".",
105110
"body": "self.$0",
106-
"description" : "shortend snippet to reference the self property in an object."
111+
"description" : "Shortend snippet to reference the self property in an object."
107112
},
108113
"__magic__": {
109114
"prefix": "__",

snippets/comprehension.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"List comprehension": {
33
"prefix": "lc",
44
"body": "[${1:value} for ${2:value} in ${3:iterable}]$0",
5-
"description" : "list comprehension for creating a list based on existing lists."
5+
"description" : "List comprehension for creating a list based on existing lists."
66
},
77
"List comprehension if else": {
88
"prefix": "lcie",
99
"body": "[${1:value} if ${2:condition} else ${3:condition} for ${4:value} in ${5:iterable}]$0",
10-
"description" : "list comprehension for creating a list based on existing lists, with conditional if-else statement."
10+
"description" : "List comprehension for creating a list based on existing lists, with conditional if-else statement."
1111
},
1212
"List comprehension if filter": {
1313
"prefix": "lci",
1414
"body": "[${1:value} for ${2:value} in ${3:iterable} if ${4:condition}$0]",
15-
"description" : "list comprehension for creating a list based on existing lists, with conditional if statement."
15+
"description" : "List comprehension for creating a list based on existing lists, with conditional if statement."
1616
},
1717
"Dictionary comprehension": {
1818
"prefix": "dc",

0 commit comments

Comments
 (0)