Closed derVedro closed 3 years ago
That should be the use of conditional there. Yes. it does not fail.
def elements(self, conditional=None):
yield self
for q in self.select(conditional):
yield q
The offending code here tests the conditional with the select sub-elements but not with self which is merely yielded without qualification. I've corrected that and It'll be out in the next version due out after the rest of the test code passes including the new test which basically consists of your issue here.
Fixed in latest version.
Thank you for bringing this to my attention. Sorry I was late in reviewing it.
If I understand it right, elements method takes a test function as conditional argument and makes a generator that returns only the elements that satisfy the test condition. Let me show a example:
I expect to get only Path objects. But that's not the case. I get three elements, first of them is a SVG that contains all the Paths.