Unfortunately not every mistake gets noticed on the first pass.
I did happen to find this post while looking around, which seems to have used the same approach as your original one (so might be what you’re referring to), but the question being asked wasn’t focused on the presented code or perceived errors in the data, so I’m not too surprised that the code issue got missed at the time.
Fair enough that that’s confusing though - incorrect references always make things more complicated than they need to be, and ideally we’d have an example of processing and doing something with the data included with the library, since that’s a reasonably basic usage of it, but that’s not something we’ve made at this stage.
My bad - that looks to be missing in the library, so there might be an issue with the generator, or how it’s defined in the protocol. That said, it might also be intentional because in Python the profile data container has a queryable length (using the len
builtin).
Either way, I’ve updated the example snippet to use len
instead