beetbox / pyacoustid

Python bindings for Chromaprint acoustic fingerprinting and the Acoustid Web service
MIT License
325 stars 66 forks source link

`match` should not be an iterator #36

Open tooxie opened 7 years ago

tooxie commented 7 years ago

I think it makes it more complicated to work with the function because in order to subscript it one has to force it into a list first. If each result had to be fetched from the server then it would make a lot of sense to yield them one by one, but since the response is already downloaded and parsed, returning all results at once makes no difference.

sampsyo commented 7 years ago

Hi! Thanks for the suggestion. I generally like iterator-based APIs, though, and they're quite common in modern Python. Even dict.items(), for example, is an iterator these days. I agree there's not a huge performance problem to be solved here, but I think the difference is small enough that it's probably not worth the effort to change.