diff --git a/bumble/avdtp.py b/bumble/avdtp.py index 85f7ede3..fd79dc33 100644 --- a/bumble/avdtp.py +++ b/bumble/avdtp.py @@ -580,10 +580,10 @@ def __init__( self.service_category = service_category self.service_capabilities_bytes = service_capabilities_bytes - def to_string(self, details: List[str] = []) -> str: + def to_string(self, details: Optional[List[str]] = None) -> str: attributes = ','.join( [name_or_number(AVDTP_SERVICE_CATEGORY_NAMES, self.service_category)] - + details + + (details or []) ) return f'ServiceCapabilities({attributes})' diff --git a/bumble/gatt.py b/bumble/gatt.py index 3e679bbe..ea65116d 100644 --- a/bumble/gatt.py +++ b/bumble/gatt.py @@ -345,7 +345,7 @@ def __init__( uuid: Union[str, UUID], characteristics: List[Characteristic], primary=True, - included_services: List[Service] = [], + included_services: Iterable[Service] = (), ) -> None: # Convert the uuid to a UUID object if it isn't already if isinstance(uuid, str): @@ -361,7 +361,7 @@ def __init__( uuid.to_pdu_bytes(), ) self.uuid = uuid - self.included_services = included_services[:] + self.included_services = list(included_services) self.characteristics = characteristics[:] self.primary = primary @@ -395,7 +395,7 @@ def __init__( self, characteristics: List[Characteristic], primary: bool = True, - included_services: List[Service] = [], + included_services: Iterable[Service] = (), ) -> None: super().__init__(self.UUID, characteristics, primary, included_services)