Python Variant toList vs Next

20 views
Skip to first unread message

jnbank...@gmail.com

unread,
May 21, 2018, 11:49:06 AM5/21/18
to Gremlin-users
I am using the python variant and was trying to understand the difference between the toList() and next() commands. Would someone be able to point me in the right direction? Thanks.

Stephen Mallette

unread,
May 21, 2018, 11:52:29 AM5/21/18
to Gremlin-users
toList() basically behaves like a fold() and iterates the traversal storing the results in a collection. next() just gets the next object in the traversal meaning that there may still be objects left in the traversal which you could check for with hasNext(). next()/hasNext() follow standard java Iterator semantics.

On Mon, May 21, 2018 at 11:49 AM, <jnbank...@gmail.com> wrote:
I am using the python variant and was trying to understand the difference between the toList() and next() commands. Would someone be able to point me in the right direction? Thanks.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/97a1a121-8b1c-47e1-bc64-7171a22c97be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages