aiodns
aiodns copied to clipboard
Not namedtuple-like?
The README says:
results are always namedtuple-like objects
If I try to do a[0] or val, ttl = a an Exception occurs. It would appear these objects are not like tuples. We should probably reword this part of the documentation...
Or, if we wanted to make them namedtuple, it could allow some flexibility.
I was attempting to get the result of A, AAAA, and TXT together, with:
for val, _ttl in results
If I need to use attributes, then I need to special case the TXT result, as it uses a different attribute name.
IMHO it'd be better to fix the docs and not say that. A dataclass-style object makes more sense.