What is the best way to skip entries in a generator expression that are created using a function and another generator?
In essence, I am looking for an expression that looks like this:
some_iter = (some_function(_x, _y, **kwargs) or continue for _x, _y in some_generator(*x))
(but the continue
statement obviously doesn't work in this context)
Functionally, it should act like this:
def some_iter(*x):
for _x, _y in some_generator(*x):
x = some_function(_x, _y, **kwargs)
if x:
yield x