I built an iterable object A that contains a list of other objects B. I want to be able to automatically skip a specific object B in the list if it is marked as bad when object A is used in a for loop.
class A(): def __init__(self): self.Blist = [B(1), B(2), B(3)]
However, I cannot figure out how to write a conditional expression that is commented out in the pseudo-code above without missing an iteration request (the else clause does not work)
Thanks!
source share