vim/bundle/snipmate/snippets/python.snippets @ 67946af79b72

vim: save when losing focus
author Steve Losh <steve@stevelosh.com>
date Fri, 17 Sep 2010 11:02:02 -0400
parents 133dfddef597
children (none)
snippet #!
	#!/usr/bin/env python
snippet from
	from ${1:sys} import ${2:*}
snippet while
	while ${1:True}:
		${2:pass}
snippet for
	for ${1:x} in ${2:xs}:
		${3:pass}
snippet fore
	for ${1:n}, ${2:item} in enumerate(${3:items}):
		${4:pass}
snippet class
	class ${1:ClassName}(${2:object}):
		def __init__(self${3:, args}):
			${4:super($1, self).__init__()}
			${5}
snippet def
	def ${1:function}(${2}):
		${3:pass}
snippet defs
	def ${1:method}(self${2}):
		${3:pass}
snippet lam
	lambda ${1:args}: ${2:action}
snippet .
	self.
snippet try Try/Except
	try:
		${1:pass}
	except ${2:Exception}, ${3:e}:
		${4:raise $3}
snippet try Try/Except/Else
	try:
		${1:pass}
	except ${2:Exception}, ${3:e}:
		${4:raise $3}
	else:
		${5:pass}
snippet try Try/Except/Finally
	try:
		${1:pass}
	except ${2:Exception}, ${3:e}:
		${4:raise $3}
	finally:
		${5:pass}
snippet try Try/Except/Else/Finally
	try:
		${1:pass}
	except ${2:Exception}, ${3:e}:
		${4:raise $3}
	else:
		${5:pass}
	finally:
		${6:pass}
snippet ifmain
	if __name__ == '__main__':
		${1:main()}
snippet _
	__${1:init}__${2}
snippet ***
	*args, **kwargs