1 diff -ruN a/quodlibet/packages/raven/context.py b/quodlibet/packages/raven/context.py
2 --- a/quodlibet/packages/raven/context.py 2021-02-28 20:26:26.003186000 +0100
3 +++ b/quodlibet/packages/raven/context.py 2021-12-04 11:59:34.974753115 +0100
6 from __future__ import absolute_import
8 -from collections import Mapping, Iterable
10 + from collections import abc
12 + import collections as abc # type: ignore
13 from threading import local
14 from weakref import ref as weakref
20 -class Context(local, Mapping, Iterable):
21 +class Context(local, abc.Mapping, abc.Iterable):
23 Stores context until cleared.
25 diff -ruN a/quodlibet/player/gstbe/util.py b/quodlibet/player/gstbe/util.py
26 --- a/quodlibet/player/gstbe/util.py 2021-02-28 20:26:26.007186000 +0100
27 +++ b/quodlibet/player/gstbe/util.py 2021-12-04 11:59:34.978086457 +0100
29 # the Free Software Foundation; either version 2 of the License, or
30 # (at your option) any later version.
34 + from collections import abc
36 + import collections as abc # type: ignore
39 from typing import Iterable, Tuple
41 return pipe, pipeline_desc
44 -class TagListWrapper(collections.Mapping):
45 +class TagListWrapper(abc.Mapping):
46 def __init__(self, taglist, merge=False):
49 diff -ruN a/quodlibet/util/collection.py b/quodlibet/util/collection.py
50 --- a/quodlibet/util/collection.py 2021-02-28 20:26:26.015186000 +0100
51 +++ b/quodlibet/util/collection.py 2021-12-04 12:01:23.532557722 +0100
54 from quodlibet.formats._audio import PEOPLE as _PEOPLE
55 from quodlibet.pattern import Pattern
56 -from collections import Iterable
58 + from collections import abc
60 + import collections as abc # type: ignore
62 from quodlibet.util import is_windows
63 from quodlibet.util.path import escape_filename, unescape_filename, limit_path
68 -class Playlist(Collection, Iterable):
69 +class Playlist(Collection, abc.Iterable):
70 """A Playlist is a `Collection` that has list-like features
71 Songs can appear more than once.
74 __instances: Set["Playlist"] = set()
77 - def playlists_featuring(cls, song: AudioFile) -> Iterable[Playlist]:
78 + def playlists_featuring(cls, song: AudioFile) -> abc.Iterable[Playlist]:
79 """Returns a generator yielding playlists in which this song appears"""
80 return (pl for pl in cls.__instances if song in pl._list)
82 diff -ruN a/quodlibet/util/collections.py b/quodlibet/util/collections.py
83 --- a/quodlibet/util/collections.py 2021-02-28 20:26:26.015186000 +0100
84 +++ b/quodlibet/util/collections.py 2021-12-04 12:03:18.200303036 +0100
87 from __future__ import absolute_import
89 -from collections import MutableSequence, defaultdict
91 + from collections import abc
93 + import collections as abc # type: ignore
94 +from collections import defaultdict
96 from .misc import total_ordering
99 return self.__dict.keys()
102 -class HashedList(MutableSequence):
103 +class HashedList(abc.MutableSequence):
104 """A list-like collection that can only take hashable items
105 and provides fast membership tests.
107 diff -ruN a/quodlibet/util/http.py b/quodlibet/util/http.py
108 --- a/quodlibet/util/http.py 2021-02-28 20:26:26.015186000 +0100
109 +++ b/quodlibet/util/http.py 2021-12-04 12:13:21.410973754 +0100
111 # (at your option) any later version.
114 -from collections import Callable
115 +from collections.abc import Callable
116 from typing import Optional, Any
118 from gi.repository import Soup, Gio, GLib, GObject