[SVN] r4774 (Python)

Kumar McMillan kumar.mcmillan at gmail.com
Tue Aug 15 14:48:44 UTC 2006


typing in python is very easy, which is probably why there aren't many snippets.  In keeping with a DRY philosophy I prudently added two snippets which are quite possibly some of the few annoying things to type in python.  

The __magic__ snippet is simply a convenient way to close a pair of "__" underscores *however* I decided against making this a smart typing pair because there may just be enough whacky developers out there who still think it's a good idea to make hyper-private attributes like __donttouchme() in their code.  In other words, if anyone would rather have "__" as a smart-typing pair then please by all means change it.

Note that the "super" snippet has been left intentionally without tab stops around the two arguments because, say, if you wanted to type super(MyClass, self).__init__() then you might as well just type it instead of snippet-type it since it is an edge-case.  If anything about python is annoying, it is this, calling super methods in an abstract way and I wanted to keep this snippet fast (i.e. super + tab + method name + tab = done).

Changed:
A   trunk/Bundles/Python.tmbundle/Snippets/__magic__.tmSnippet
A   trunk/Bundles/Python.tmbundle/Snippets/super(self___class__, self)___init__().tmSnippet



More information about the textmate-dev mailing list