]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Add type hints for `Rdata` and `GenericRdata` constructors (#1190)
authorJeremy Lainé <jeremy.laine@m4x.org>
Mon, 7 Apr 2025 14:55:15 +0000 (16:55 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Apr 2025 14:55:15 +0000 (07:55 -0700)
dns/rdata.py

index 6e5a6f317732c5c3b8e4450f452ace20503f784c..f90985ea04bda36fd1b88097348a0707e6cde087 100644 (file)
@@ -133,7 +133,11 @@ class Rdata:
 
     __slots__ = ["rdclass", "rdtype", "rdcomment"]
 
-    def __init__(self, rdclass, rdtype):
+    def __init__(
+        self,
+        rdclass: dns.rdataclass.RdataClass,
+        rdtype: dns.rdatatype.RdataType,
+    ) -> None:
         """Initialize an rdata.
 
         *rdclass*, an ``int`` is the rdataclass of the Rdata.
@@ -614,7 +618,12 @@ class GenericRdata(Rdata):
 
     __slots__ = ["data"]
 
-    def __init__(self, rdclass, rdtype, data):
+    def __init__(
+        self,
+        rdclass: dns.rdataclass.RdataClass,
+        rdtype: dns.rdatatype.RdataType,
+        data: bytes,
+    ) -> None:
         super().__init__(rdclass, rdtype)
         self.data = data