summaryrefslogtreecommitdiff
path: root/.emacs.d/snippets/python-mode
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/snippets/python-mode')
-rw-r--r--.emacs.d/snippets/python-mode/cls2
-rw-r--r--.emacs.d/snippets/python-mode/dunder5
-rw-r--r--.emacs.d/snippets/python-mode/property_getter13
-rw-r--r--.emacs.d/snippets/python-mode/property_setter19
4 files changed, 38 insertions, 1 deletions
diff --git a/.emacs.d/snippets/python-mode/cls b/.emacs.d/snippets/python-mode/cls
index 9f8b27c..3e3863a 100644
--- a/.emacs.d/snippets/python-mode/cls
+++ b/.emacs.d/snippets/python-mode/cls
@@ -3,5 +3,5 @@
3# key: cls 3# key: cls
4# group: object oriented 4# group: object oriented
5# -- 5# --
6class ${1:class}: 6class ${1:class}(${2:object}):
7 $0 7 $0
diff --git a/.emacs.d/snippets/python-mode/dunder b/.emacs.d/snippets/python-mode/dunder
new file mode 100644
index 0000000..7c97482
--- /dev/null
+++ b/.emacs.d/snippets/python-mode/dunder
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: dunder
3# key: dd
4# --
5__${name}__$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/property_getter b/.emacs.d/snippets/python-mode/property_getter
new file mode 100644
index 0000000..332896c
--- /dev/null
+++ b/.emacs.d/snippets/python-mode/property_getter
@@ -0,0 +1,13 @@
1# -*- mode: snippet -*-
2# name: property_getter
3# key: pg
4# group : code_generation
5# --
6@property
7def ${1:name}(self):
8 """
9 $1-property
10 """
11 return self.${2:value}
12
13$0
diff --git a/.emacs.d/snippets/python-mode/property_setter b/.emacs.d/snippets/python-mode/property_setter
new file mode 100644
index 0000000..40c879b
--- /dev/null
+++ b/.emacs.d/snippets/python-mode/property_setter
@@ -0,0 +1,19 @@
1# -*- mode: snippet -*-
2# name: property_setter
3# key: ps
4# group : code_generation
5# --
6@property
7def ${1:name}(self):
8 """
9 $1-property
10 """
11 return self.${2:value}
12
13@$1.setter
14def $1(self, value):
15 """
16 $1-property setter
17 """
18 self.$2 = value
19$0