[gnome-music/wip/jfelder/artstack-type-hint: 14/15] artstack: Add missing type hint in the constructor
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/artstack-type-hint: 14/15] artstack: Add missing type hint in the constructor
- Date: Wed, 2 Feb 2022 10:33:50 +0000 (UTC)
commit a15c7a1d4ee37ee3eff02d132cd21f625750c396
Author: Jean Felder <jfelder src gnome org>
Date: Sun Dec 12 14:31:31 2021 +0100
artstack: Add missing type hint in the constructor
gnomemusic/widgets/artstack.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/widgets/artstack.py b/gnomemusic/widgets/artstack.py
index d0a72e504..c69fa0607 100644
--- a/gnomemusic/widgets/artstack.py
+++ b/gnomemusic/widgets/artstack.py
@@ -22,12 +22,23 @@
# code, but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
+from typing import Optional, Union
+import typing
+
from gi.repository import GObject, Gtk
from gnomemusic.asyncqueue import AsyncQueue
from gnomemusic.artcache import ArtCache
from gnomemusic.defaulticon import DefaultIcon
from gnomemusic.utils import ArtSize
+if typing.TYPE_CHECKING:
+ from gnomemusic.corealbum import CoreAlbum
+ from gnomemusic.coreartist import CoreArtist
+ from gnomemusic.coresong import CoreSong
+
+
+if typing.TYPE_CHECKING:
+ CoreObject = Union[CoreAlbum, CoreArtist, CoreSong]
class ArtStack(Gtk.Stack):
@@ -51,7 +62,7 @@ class ArtStack(Gtk.Stack):
self._art_type = DefaultIcon.Type.ALBUM
self._cache = ArtCache()
- self._coreobject = None
+ self._coreobject: Optional[CoreObject] = None
self._handler_id = 0
self._size = size
self._thumbnail_id = 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]