Skip to content

Commit

Permalink
Replace unsafe default values
Browse files Browse the repository at this point in the history
  • Loading branch information
zxzxwu committed Sep 18, 2024
1 parent 56ca196 commit f06a357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bumble/avdtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})'

Expand Down
6 changes: 3 additions & 3 deletions bumble/gatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f06a357

Please sign in to comment.