From 37e4445391e7ab13cc74724d1e9b9bca8fdecfff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jeremy=20Lain=C3=A9?= Date: Mon, 7 Apr 2025 16:55:15 +0200 Subject: [PATCH] Add type hints for `Rdata` and `GenericRdata` constructors (#1190) --- dns/rdata.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 -- 2.47.3