From e0e0883a50d92a54bc079fa58708da41fcebf5c5 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Thu, 24 Nov 2022 07:20:58 -0800 Subject: [PATCH] Fix type lint from latest mypy. --- dns/exception.py | 2 +- dns/node.py | 2 +- dns/rdata.py | 2 +- dns/update.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dns/exception.py b/dns/exception.py index 3b2f1cdc..0e6245f7 100644 --- a/dns/exception.py +++ b/dns/exception.py @@ -90,7 +90,7 @@ class DNSException(Exception): Resulting dictionary has to have keys necessary for str.format call on fmt class variable. """ - fmtargs: Dict[str, Any] = {} + fmtargs = {} for kw, data in kwargs.items(): if isinstance(data, (list, set)): # convert list of to list of str() diff --git a/dns/node.py b/dns/node.py index d870a299..f89c8321 100644 --- a/dns/node.py +++ b/dns/node.py @@ -92,7 +92,7 @@ class Node: def __init__(self): # the set of rdatasets, represented as a list. - self.rdatasets: List[dns.rdataset.Rdataset] = [] + self.rdatasets = [] def to_text(self, name: dns.name.Name, **kw: Dict[str, Any]) -> str: """Convert a node to text format. diff --git a/dns/rdata.py b/dns/rdata.py index dc2ad97a..5c70214b 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -143,7 +143,7 @@ class Rdata: self.rdclass = self._as_rdataclass(rdclass) self.rdtype = self._as_rdatatype(rdtype) - self.rdcomment: Optional[str] = None + self.rdcomment = None def _get_all_slots(self): return itertools.chain.from_iterable( diff --git a/dns/update.py b/dns/update.py index 91c8aa49..647e5b19 100644 --- a/dns/update.py +++ b/dns/update.py @@ -317,7 +317,7 @@ class UpdateMessage(dns.message.Message): # lgtm[py/missing-equals] def absent( self, name: Union[dns.name.Name, str], - rdtype: Union[dns.rdatatype.RdataType, str] = None, + rdtype: Optional[Union[dns.rdatatype.RdataType, str]] = None, ) -> None: """Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.""" -- 2.47.3