On Fri, 21 Apr 2006 22:51:11 +0200 Bram Moolenaar <[EMAIL PROTECTED]> wrote:
> > a[M:N] does truncate when N > len(a). However, this still gives an > > error when len(a) = 0. Can this be changed as well to return just an > > empty list? I appreciate your changing the previous behavior. It made > > things a lot simpler... I am presently aiming to release a beta > > version of vim-latex for vim7 around the same time you release vim7. > > The code has reduce about 30% (!!!) using the list/dictionaries and > > expanded functions of vim7. > > I think trying to get items from an empty list should produce an error > message. FWIW it doesn't cause an error in python, it returns an empty list. Wouldn't it be more consistent to automatically handle any out of range issues for a[M:N] or give an error for all of them? Handling N > len(a) except when "a" happens to be 0 seems a bit counterintuitive. Sean