Skip to content

Commit

Permalink
Modify a type annotation of PingParserInterface.parse method
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Mar 27, 2021
1 parent fda6fc2 commit 59d120a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pingparsing/_interface.py
@@ -1,10 +1,10 @@
import abc
from typing import List
from typing import Sequence

from ._stats import PingStats


class PingParserInterface(metaclass=abc.ABCMeta):
@abc.abstractmethod
def parse(self, ping_message: List[str]) -> PingStats: # pragma: no cover
def parse(self, ping_message: Sequence[str]) -> PingStats: # pragma: no cover
pass
10 changes: 5 additions & 5 deletions pingparsing/_parser.py
Expand Up @@ -183,7 +183,7 @@ def _stats_headline_pattern(self) -> str:
def _is_support_packet_duplicate(self) -> bool: # pragma: no cover
return False

def parse(self, ping_message: List[str]) -> PingStats: # pragma: no cover
def parse(self, ping_message: Sequence[str]) -> PingStats: # pragma: no cover
return PingStats()

def _preprocess_parse_stats(
Expand Down Expand Up @@ -226,7 +226,7 @@ def _stats_headline_pattern(self) -> str:
def _is_support_packet_duplicate(self) -> bool:
return True

def parse(self, ping_message: List[str]) -> PingStats:
def parse(self, ping_message: Sequence[str]) -> PingStats:
icmp_replies = self._parse_icmp_reply(ping_message)
stats_headline, packet_info_line, body_line_list = self._preprocess_parse_stats(
lines=ping_message
Expand Down Expand Up @@ -303,7 +303,7 @@ def _stats_headline_pattern(self) -> str:
def _is_support_packet_duplicate(self) -> bool:
return False

def parse(self, ping_message: List[str]) -> PingStats:
def parse(self, ping_message: Sequence[str]) -> PingStats:
icmp_replies = self._parse_icmp_reply(ping_message)
stats_headline, packet_info_line, body_line_list = self._preprocess_parse_stats(
lines=ping_message
Expand Down Expand Up @@ -385,7 +385,7 @@ def _stats_headline_pattern(self) -> str:
def _is_support_packet_duplicate(self) -> bool:
return True

def parse(self, ping_message: List[str]) -> PingStats:
def parse(self, ping_message: Sequence[str]) -> PingStats:
icmp_replies = self._parse_icmp_reply(ping_message)
stats_headline, packet_info_line, body_line_list = self._preprocess_parse_stats(
lines=ping_message
Expand Down Expand Up @@ -466,7 +466,7 @@ def _icmp_reply_pattern(self) -> str:
def _is_support_packet_duplicate(self) -> bool:
return True

def parse(self, ping_message: List[str]) -> PingStats:
def parse(self, ping_message: Sequence[str]) -> PingStats:
icmp_replies = self._parse_icmp_reply(ping_message)
stats_headline, packet_info_line, body_line_list = self._preprocess_parse_stats(
lines=ping_message
Expand Down

0 comments on commit 59d120a

Please sign in to comment.