From: Jeremy Lainé Date: Mon, 7 Apr 2025 14:55:15 +0000 (+0200) Subject: Add type hints for `Rdata` and `GenericRdata` constructors (#1190) X-Git-Tag: v2.8.0rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37e4445391e7ab13cc74724d1e9b9bca8fdecfff;p=thirdparty%2Fdnspython.git Add type hints for `Rdata` and `GenericRdata` constructors (#1190) --- diff --git a/dns/rdata.py b/dns/rdata.py index 6e5a6f31..f90985ea 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -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