Skip to content

Commit b65cf64

Browse files
committed
Fix mypy typing errors
1 parent d7b1acf commit b65cf64

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

pythonosc/osc_message_builder.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55

66
from typing import List, Tuple, Union, Any, Optional
77

8-
98
ArgValue = Union[str, bytes, bool, int, float, osc_types.MidiPacket, list]
109

11-
1210
class BuildError(Exception):
1311
"""Error raised when an incomplete message is trying to be built."""
1412

15-
1613
class OscMessageBuilder(object):
1714
"""Builds arbitrary OscMessage instances."""
1815

@@ -35,7 +32,7 @@ class OscMessageBuilder(object):
3532
ARG_TYPE_FLOAT, ARG_TYPE_DOUBLE, ARG_TYPE_INT, ARG_TYPE_INT64, ARG_TYPE_BLOB, ARG_TYPE_STRING,
3633
ARG_TYPE_RGBA, ARG_TYPE_MIDI, ARG_TYPE_TRUE, ARG_TYPE_FALSE, ARG_TYPE_NIL)
3734

38-
def __init__(self, address: str=None) -> None:
35+
def __init__(self, address: Optional[str] = None) -> None:
3936
"""Initialize a new builder for a message.
4037
4138
Args:
@@ -69,7 +66,7 @@ def _valid_type(self, arg_type: str) -> bool:
6966
return True
7067
return False
7168

72-
def add_arg(self, arg_value: ArgValue, arg_type: str=None) -> None:
69+
def add_arg(self, arg_value: ArgValue, arg_type: Optional[str] = None) -> None:
7370
"""Add a typed argument to this message.
7471
7572
Args:

pythonosc/osc_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, server_address: Tuple[str, int], dispatcher: Dispatcher, bind
5757
dispatcher: Dispatcher this server will use
5858
(optional) bind_and_activate: default=True defines if the server has to start on call of constructor
5959
"""
60-
super().__init__(server_address, _UDPHandler, bind_and_activate) # type: ignore[call-arg] # https://github.com/python/typeshed/pull/8542
60+
super().__init__(server_address, _UDPHandler, bind_and_activate)
6161
self._dispatcher = dispatcher
6262

6363
def verify_request(self, request: _RequestType, client_address: _AddressType) -> bool:

0 commit comments

Comments
 (0)