Skip to content

Commit

Permalink
Fix type anotations
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Oct 6, 2023
1 parent 7c321d8 commit a678f2f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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,11 +59,11 @@ 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) -> Sequence[str]:
return self._channel.servers

@nameservers.setter
def nameservers(self, value: List[str]) -> None:
def nameservers(self, value: Sequence[str]) -> None:
self._channel.servers = value

@staticmethod
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 a678f2f

Please sign in to comment.