Skip to content

Commit

Permalink
Fix type anotation
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Oct 6, 2023
1 parent 7c321d8 commit a443dcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aiodns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
List,
Optional,
Set,
Union
Sequence
)

from . import error
Expand Down Expand Up @@ -45,7 +45,7 @@
}

class DNSResolver:
def __init__(self, nameservers: Optional[List[str]] = None,
def __init__(self, nameservers: Optional[Sequence[str]] = None,
loop: Optional[asyncio.AbstractEventLoop] = None,
**kwargs: Any) -> None:
self.loop = loop or asyncio.get_event_loop()
Expand All @@ -59,7 +59,7 @@ def __init__(self, nameservers: Optional[List[str]] = None,
self._timer = None # type: Optional[asyncio.TimerHandle]

@property
def nameservers(self) -> List[Union[str, bytes]]:
def nameservers(self) -> List[str]:
return self._channel.servers

@nameservers.setter
Expand All @@ -75,7 +75,7 @@ def _callback(fut: asyncio.Future, result: Any, errorno: int) -> None:
else:
fut.set_result(result)

def query(self, host: str, qtype: str, qclass: str=None) -> asyncio.Future:
def query(self, host: str, qtype: str, qclass: Optional[str]=None) -> asyncio.Future:
try:
qtype = query_type_map[qtype]
except KeyError:
Expand Down

0 comments on commit a443dcf

Please sign in to comment.