UltiSnips/PySnippets/python.snippets

10 lines
301 B
Plaintext
Raw Normal View History

2009-07-04 06:15:12 -04:00
snippet cls
class ${1:MyClass}(${2:object}):
def __init__( self${4/([^,])?(.*)/(?1:, )/}${4:arg} ):
"""
TODO: Fill me in
"""
${2/object$|(.+)/(?1:\t\t$0.__init__\(self\)\n\n)/}${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:\t\tself._$2 = $2\n)/g} $0
endsnippet