← Back to team overview

yade-users team mailing list archive

Re: [Question #660861]: Length of O.bodies after erasing a body

 

Question #660861 on Yade changed:
https://answers.launchpad.net/yade/+question/660861

Jérôme Duriez posted a new comment:
Hello,

I confirm the behavior you describe and understand your reaction.

As a possible workaround remark before other answers, and because your
"looping over len(O.bodies)" made me think you might eventually be just
interested in looping over bodies, let me precise that looping directly
over bodies with "for b in O.bodies:" (instead "for i in
range(len(O.bodies)):", maybe) gracefully skips non-existing bodies.

(And sorry if this does not help, here)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.