From: Petr Špaček Date: Wed, 21 May 2025 13:19:25 +0000 (+0200) Subject: Shorten syntax to access Name object X-Git-Tag: v9.21.11~22^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb6b990af3ec44e0b0d4e14d76d8c4bfba9692b;p=thirdparty%2Fbind9.git Shorten syntax to access Name object dns.name all over the place does not make it easier to read the code at all, and I'm going to add lot more code here. --- diff --git a/bin/tests/system/isctest/name.py b/bin/tests/system/isctest/name.py index d992ae3fce9..867380a8f24 100644 --- a/bin/tests/system/isctest/name.py +++ b/bin/tests/system/isctest/name.py @@ -9,12 +9,12 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -import dns.name +from dns.name import Name -def prepend_label(label: str, name: dns.name.Name) -> dns.name.Name: - return dns.name.Name((label,) + name.labels) +def prepend_label(label: str, name: Name) -> Name: + return Name((label,) + name.labels) -def len_wire_uncompressed(name: dns.name.Name) -> int: +def len_wire_uncompressed(name: Name) -> int: return len(name) + sum(map(len, name.labels))