]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Shorten syntax to access Name object
authorPetr Špaček <pspacek@isc.org>
Wed, 21 May 2025 13:19:25 +0000 (15:19 +0200)
committerPetr Špaček <pspacek@isc.org>
Tue, 29 Jul 2025 08:00:36 +0000 (10:00 +0200)
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.

bin/tests/system/isctest/name.py

index d992ae3fce9edd840e646b4306e3a5a5e33a4731..867380a8f24fde79b9495799dcf29ff153c20439 100644 (file)
@@ -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))