else/SublimeSnippets/listget.sublime-snippet

15 lines
449 B
Text
Raw Normal View History

2019-04-17 01:39:00 +00:00
<snippet>
<content><![CDATA[
def listget(l, index, default=None):
try:
return l[index]
except IndexError:
return default
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>listget</tabTrigger>
</snippet>