78c390b026
I'm not much of a python pro, but it appears the correct way to iterate is next(i) instead of i.next(). i.next() has been renamed to i.__next__() on python3, but next(i) works on both. Pasted below is the following test script ran through python 2.6, 2.7, and 3.3: i = iter("1,2".split(",")) next(i) i.next() i.__next__() next(i) Python 2.6.8 (unknown, Jan 26 2013, 14:35:25) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> i = iter("1,2".split(",")) >>> next(i) '1' >>> i.next() '2' >>> i.__next__() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'listiterator' object has no attribute '__next__' >>> next(i) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> Python 2.7.6 (default, Dec 6 2013, 20:05:37) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> i = iter("1,2".split(",")) >>> next(i) '1' >>> i.next() '2' >>> i.__next__() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'listiterator' object has no attribute '__next__' >>> next(i) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> Python 3.3.3 (default, Jan 2 2014, 19:09:02) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> i = iter("1,2".split(",")) >>> next(i) '1' >>> i.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'list_iterator' object has no attribute 'next' >>> i.__next__() '2' >>> next(i) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com> |
||
---|---|---|
.. | ||
all.snippets | ||
bib.snippets | ||
bindzone.snippets | ||
c.snippets | ||
coffee_jasmine.snippets | ||
coffee.snippets | ||
cpp.snippets | ||
cs.snippets | ||
css.snippets | ||
d.snippets | ||
django.snippets | ||
erlang.snippets | ||
eruby.snippets | ||
go.snippets | ||
haskell.snippets | ||
help.snippets | ||
html.snippets | ||
htmldjango.snippets | ||
java.snippets | ||
javascript_jasmine.snippets | ||
javascript_jsdoc.snippets | ||
javascript.snippets | ||
jinja2.snippets | ||
json.snippets | ||
ledger.snippets | ||
lhaskell.snippets | ||
lua.snippets | ||
mako.snippets | ||
markdown.snippets | ||
objc.snippets | ||
ocaml.snippets | ||
perl.snippets | ||
php.snippets | ||
puppet.snippets | ||
python.snippets | ||
rails.snippets | ||
README | ||
rst.snippets | ||
ruby.snippets | ||
scss.snippets | ||
sh.snippets | ||
snippets.snippets | ||
tcl.snippets | ||
tex.snippets | ||
texmath.snippets | ||
vim.snippets | ||
xhtml.snippets | ||
xml.snippets | ||
zsh.snippets |
This directory contains the main scripts that come bundled with UltiSnips. Standing On The Shoulders of Giants =================================== The snippets have been collected from various other project which I want to express my gratitude for. My main source for inspiration where the following two projects: TextMate: http://svn.textmate.org/trunk/Bundles/ SnipMate: http://code.google.com/p/snipmate/ All snippets from those sources were copied and cleaned up, so that they are - not using shell script, only python (so they are cross platform compatible) - not using any feature that UltiSnips doesn't offer UltiSnips has seen contributions by various individuals. Those contributions have been merged into this collection seamlessly and without further comments. -- vim:ft=rst:nospell: