Hi Gerrit,

2010/11/24 Gerrit Holl <gerrit.h...@ltu.se>

> Hi,
>
> I am looping through the rows of my table. I gave only the start
> argument, like this:
>
> (Pdb) print h5target.root.collocations.nrows
> 10821605
> (Pdb) rr = h5target.root.collocations.iterrows(start=152619)
> (Pdb) rr.next()
> /collocations.row (Row), pointing to row #152619
> (Pdb) rr.next()
> *** StopIteration:
>
> Apparently, I should also give the stop argument:
>
> (Pdb) rr = h5target.root.collocations.iterrows(start=152619, stop=-1)
> (Pdb) rr.next()
> /collocations.row (Row), pointing to row #152619
> (Pdb) rr.next()
> /collocations.row (Row), pointing to row #152620
> (Pdb) rr.next()
> /collocations.row (Row), pointing to row #152621
>
>
> Is this on purpose? If so, what is the rationale? Personally, I would
> expect a behaviour where giving only start is like T[start:], not
> T[start].

[clip]

Yes, the behaviour in PyTables is the expected one (and it is document
correctly too).  I think the reason for this was some lazyness on my part: I
wanted to share the code between the `read()` method and `iterrows()`.  That
being said, I agree that it would be better if `iterrows()` would expose
your suggested behaviour.

However, I'm not sure if we should change the current behaviour because that
may broke some existing code.  In fact, my vote would go for keeping
backwards compatibility. What others think?

At any rate, can you file a ticket so that we don't forget about this?

Cheers,

-- 
Francesc Alted
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to