| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd44ed0 commit 84f4435
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ class OscMessage(object): | |||
| 19 | 19 | ||
| 20 | 20 | def __init__(self, dgram: bytes) -> None: | |
| 21 | 21 | self._dgram = dgram | |
| 22 | - self._parameters = [] | ||
| 22 | + self._parameters = [] # type: List[Any] | ||
| 23 | 23 | self._parse_datagram() | |
| 24 | 24 | ||
| 25 | 25 | def _parse_datagram(self) -> None: | |
@@ -34,10 +34,11 @@ def _parse_datagram(self) -> None: | |||
| 34 | 34 | if type_tag.startswith(','): | |
| 35 | 35 | type_tag = type_tag[1:] | |
| 36 | 36 | ||
| 37 | - params = [] | ||
| 37 | + params = [] # type: List[Any] | ||
| 38 | 38 | param_stack = [params] | |
| 39 | 39 | # Parse each parameter given its type. | |
| 40 | 40 | for param in type_tag: | |
| 41 | + val = NotImplemented # type: Any | ||
| 41 | 42 | if param == "i": # Integer. | |
| 42 | 43 | val, index = osc_types.get_int(self._dgram, index) | |
| 43 | 44 | elif param == "h": # Int64. | |
@@ -61,7 +62,7 @@ def _parse_datagram(self) -> None: | |||
| 61 | 62 | elif param == "F": # False. | |
| 62 | 63 | val = False | |
| 63 | 64 | elif param == "[": # Array start. | |
| 64 | - array = [] | ||
| 65 | + array = [] # type: List[Any] | ||
| 65 | 66 | param_stack[-1].append(array) | |
| 66 | 67 | param_stack.append(array) | |
| 67 | 68 | elif param == "]": # Array stop. | |
@@ -105,6 +106,6 @@ def params(self) -> List[Any]: | |||
| 105 | 106 | """Convenience method for list(self) to get the list of parameters.""" | |
| 106 | 107 | return list(self) | |
| 107 | 108 | ||
| 108 | - def __iter__(self) -> Iterator[float]: | ||
| 109 | + def __iter__(self) -> Iterator[Any]: | ||
| 109 | 110 | """Returns an iterator over the parameters of this message.""" | |
| 110 | 111 | return iter(self._parameters) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments