diff --git a/librespot/audio/AudioKeyManager.py b/librespot/audio/AudioKeyManager.py index 6342713..31537ba 100644 --- a/librespot/audio/AudioKeyManager.py +++ b/librespot/audio/AudioKeyManager.py @@ -15,7 +15,7 @@ class AudioKeyManager(PacketsReceiver): _AUDIO_KEY_REQUEST_TIMEOUT: int = 20 _seqHolder: int = 0 _seqHolderLock: threading.Condition = threading.Condition() - _callbacks: dict[int, AudioKeyManager.Callback] = dict() + _callbacks: dict[int, AudioKeyManager.Callback] = {} _session: Session = None def __init__(self, session: Session): diff --git a/librespot/audio/storage/ChannelManager.py b/librespot/audio/storage/ChannelManager.py index 3c11f46..0c57533 100644 --- a/librespot/audio/storage/ChannelManager.py +++ b/librespot/audio/storage/ChannelManager.py @@ -15,7 +15,7 @@ import threading class ChannelManager(Closeable, PacketsReceiver.PacketsReceiver): CHUNK_SIZE: int = 128 * 1024 _LOGGER: logging = logging.getLogger(__name__) - _channels: dict[int, Channel] = dict() + _channels: dict[int, Channel] = {} _seqHolder: int = 0 _seqHolderLock: threading.Condition = threading.Condition() _executorService: concurrent.futures.ThreadPoolExecutor = concurrent.futures.ThreadPoolExecutor( diff --git a/librespot/core/Session.py b/librespot/core/Session.py index 5285b05..669a9a7 100644 --- a/librespot/core/Session.py +++ b/librespot/core/Session.py @@ -60,11 +60,11 @@ class Session(Closeable, SubListener, DealerClient.MessageListener): _authLock: threading.Condition = threading.Condition() _authLockBool: bool = False _client: requests.Session = None - _closeListeners: list[Session.CloseListener] = list() + _closeListeners: list[Session.CloseListener] = [] _closeListenersLock: threading.Condition = threading.Condition() - _reconnectionListeners: list[Session.ReconnectionListener] = list() + _reconnectionListeners: list[Session.ReconnectionListener] = [] _reconnectionListenersLock: threading.Condition = threading.Condition() - _userAttributes: dict[str, str] = dict() + _userAttributes: dict[str, str] = {} _conn: Session.ConnectionHolder = None _cipherPair: CipherPair = None _receiver: Session.Receiver = None @@ -379,10 +379,10 @@ class Session(Closeable, SubListener, DealerClient.MessageListener): with self._closeListenersLock: for listener in self._closeListeners: listener.on_closed() - self._closeListeners: list[Session.CloseListener] = list() + self._closeListeners: list[Session.CloseListener] = [] self._reconnectionListeners: list[ - Session.ReconnectionListener] = list() + Session.ReconnectionListener] = [] self._LOGGER.info("Closed session. device_id: {}".format( self._inner.device_id)) diff --git a/librespot/mercury/MercuryClient.py b/librespot/mercury/MercuryClient.py index 64be030..253a4c1 100644 --- a/librespot/mercury/MercuryClient.py +++ b/librespot/mercury/MercuryClient.py @@ -17,11 +17,11 @@ class MercuryClient(PacketsReceiver.PacketsReceiver, Closeable): _MERCURY_REQUEST_TIMEOUT: int = 3 _seqHolder: int = 1 _seqHolderLock: threading.Condition = threading.Condition() - _callbacks: dict[int, Callback] = dict() + _callbacks: dict[int, Callback] = {} _removeCallbackLock: threading.Condition = threading.Condition() - _subscriptions: list[MercuryClient.InternalSubListener] = list() + _subscriptions: list[MercuryClient.InternalSubListener] = [] _subscriptionsLock: threading.Condition = threading.Condition() - _partials: dict[int, bytes] = dict() + _partials: dict[int, bytes] = {} _session: Session = None def __init__(self, session: Session): diff --git a/librespot/player/Player.py b/librespot/player/Player.py index 20e5d12..d2c3c76 100644 --- a/librespot/player/Player.py +++ b/librespot/player/Player.py @@ -22,7 +22,7 @@ class Player(Closeable, PlayerSession.Listener, AudioSink.Listener): _conf: PlayerConfiguration = None _events: Player.EventsDispatcher = None _sink: AudioSink = None - _metrics: dict[str, PlaybackMetrics] = dict() + _metrics: dict[str, PlaybackMetrics] = {} _state: StateWrapper = None _playerSession: PlayerSession = None _releaseLineFuture = None diff --git a/librespot/player/state/DeviceStateHandler.py b/librespot/player/state/DeviceStateHandler.py index 71b8fe1..5479145 100644 --- a/librespot/player/state/DeviceStateHandler.py +++ b/librespot/player/state/DeviceStateHandler.py @@ -19,7 +19,7 @@ class DeviceStateHandler: _LOGGER: logging = logging.getLogger(__name__) _session: Session = None _deviceInfo: Connect.DeviceInfo = None - _listeners: list[DeviceStateHandler.Listener] = list() + _listeners: list[DeviceStateHandler.Listener] = [] _putState: Connect.PutStateRequest = None _putStateWorker: concurrent.futures.ThreadPoolExecutor = ( concurrent.futures.ThreadPoolExecutor())