Permalink
Browse files

Add snippet for defining functions

The 'defs' snippet defines only methods. We need a simple 'def' snippet which expands to a simple one argument function.
  • Loading branch information...
1 parent be8702e commit 18355c60e346e572f1c722ad9e75572c4afbf199 @ankushagarwal ankushagarwal committed Mar 4, 2014
Showing with 3 additions and 0 deletions.
  1. +3 −0 snippets/language-python.cson
@@ -26,6 +26,9 @@
'New Method':
'prefix': 'defs'
'body': 'def ${1:mname}(self, ${2:arg}):\n\t${3:pass}'
+ 'New Function':
+ 'prefix': 'def'
+ 'body': 'def ${1:fname}(${2:arg}):\n\t${3:pass}'
'New Property':
'prefix': 'property'
'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'

0 comments on commit 18355c6

Please sign in to comment.