Skip to content

Commit c032ca8

Browse files
authored
Merge pull request #161 from PeterJCLaw/update-mypy
Updates for recent mypy
2 parents b8c647b + e699f64 commit c032ca8

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

pythonosc/osc_message_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class OscMessageBuilder(object):
3535
ARG_TYPE_FLOAT, ARG_TYPE_DOUBLE, ARG_TYPE_INT, ARG_TYPE_INT64, ARG_TYPE_BLOB, ARG_TYPE_STRING,
3636
ARG_TYPE_RGBA, ARG_TYPE_MIDI, ARG_TYPE_TRUE, ARG_TYPE_FALSE, ARG_TYPE_NIL)
3737

38-
def __init__(self, address: str=None) -> None:
38+
def __init__(self, address: Optional[str] = None) -> None:
3939
"""Initialize a new builder for a message.
4040
4141
Args:
@@ -69,7 +69,7 @@ def _valid_type(self, arg_type: str) -> bool:
6969
return True
7070
return False
7171

72-
def add_arg(self, arg_value: ArgValue, arg_type: str=None) -> None:
72+
def add_arg(self, arg_value: ArgValue, arg_type: Optional[str] = None) -> None:
7373
"""Add a typed argument to this message.
7474
7575
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:

pythonosc/udp_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""UDP Clients for sending OSC messages to an OSC server"""
22

3-
try:
3+
import sys
4+
5+
if sys.version_info > (3, 5):
46
from collections.abc import Iterable
5-
except ImportError: # python 3.5
7+
else:
68
from collections import Iterable
79

810
import socket

0 commit comments

Comments
 (0)