Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit d7c1849

Browse files
Add enum snippet for creating enums
1 parent 4da7935 commit d7c1849

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Thanks!
2727
| def | New function |
2828
| adef | Async function |
2929
| property | New property |
30+
| enum | New Enum |
3031
| if | if |
3132
| for | for |
3233
| while | while |

‎snippets/base.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@
7575
"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()\n1ドル = property(**1ドル())0ドル",
7676
"description" : ""
7777
},
78+
"New enum": {
79+
"prefix": "enum",
80+
"body": [
81+
"from enum import Enum\n\n",
82+
"class ${1:MyEnum}(Enum):",
83+
"\t\"\"\"${2:Docstring for 1ドル.}\"\"\"",
84+
"\t${3:FIRST_ENUM} = \"some_value\"",
85+
"\t${4:SECOND_ENUM} = \"some_other_value\"",
86+
"\t0ドル"
87+
]
88+
}
7889
"if": {
7990
"prefix": "if",
8091
"body": "if ${1:condition}:\n\t${2:pass}0ドル",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /