0

I am iterating over a branch list multiple times and it seems that the pointer needs to be reset.

Python-gitlab v3.12.0

e.g.

    branchlist = self.project.branches.list(iterator=True)
    m_branchlist = [i for i in branchlist if (i.merged==True)]
    p_branchlist = [i for i in branchlist if (i.protected==True)]

p_branchlist will be empty as it seems the pointer is at end of list.

Is there a way to reset pointer?

For now I'm re-running the query to refresh the list before each iteration.

    branchlist = self.project.branches.list(iterator=True)
Genhob
  • 13
  • 3

0 Answers0