I am currently in a personal learning project where I read in an XML database. I find myself writing functions that gather data and I'm not sure what would be a fast way to return them.
Which is generally faster:
yield
s, or- several
append()
s within the function thenreturn
the ensuinglist
?
I would be happy to know in what situations where yield
s would be faster than append()
s or vice-versa.