Default return value of get_record
The default return value of get_record should probably be None. Instead of "" at https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L244 this should be None. Then one can easily check if there is a valid return value.
hello,
The method get_record returns a list instance in any case not to have inconsistent return statements. I usually return None if the method is supposed to return a single instance of an object.
In this case, an empty list still allows one to easily know if records have been found by doing a simple test on the list instance, which will return False if empty.
if not zone.get_record("nonexistent"):
print("no record have been found")
Did you have an issue with that ?
Regards
I see that get_record now has a a list as a default value, previously it did not. suggest_zone has a default value of the empty string instead of None, see https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L248
Ah this is a mistake, thank for pointing that out ! I'll fix it quickly
On Tue, Jun 15, 2021, 14:48 Jon Schewe @.***> wrote:
I see that get_record now has a a list as a default value, previously it did not. suggest_zone has a default value of the empty string instead of None, see https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L248
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/outini/python-powerdns/issues/10#issuecomment-861469005, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGBX24MZIRSZ22Y2O5DLDLTS5DZ7ANCNFSM45PVURDQ .