Replace deprecated typing aliases

This commit is contained in:
Josh Wu
2025-06-07 23:29:26 +08:00
parent 3a64772cc5
commit 8a0cd5d0d1
68 changed files with 366 additions and 424 deletions

View File

@@ -16,7 +16,7 @@
# Imports
# -----------------------------------------------------------------------------
import asyncio
from typing import List, Optional, Type
from typing import Optional
from typing_extensions import Self
from bumble.controller import Controller
@@ -29,7 +29,7 @@ from bumble.hci import Address
# -----------------------------------------------------------------------------
class TwoDevices:
connections: List[Optional[Connection]]
connections: list[Optional[Connection]]
def __init__(self) -> None:
self.connections = [None, None]
@@ -83,7 +83,7 @@ class TwoDevices:
return self.devices[index]
@classmethod
async def create_with_connection(cls: Type[Self]) -> Self:
async def create_with_connection(cls: type[Self]) -> Self:
devices = cls()
await devices.setup_connection()
return devices