Skip to content

Commit 9fba695

Browse files
committed
Update mypy
add some type info to APEv2File._Info to make mypy happy
1 parent 4394c43 commit 9fba695

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

mutagen/apev2.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import sys
3333
import struct
34+
from typing import Type
3435
from io import BytesIO
3536
from collections.abc import MutableSequence
3637

@@ -678,6 +679,18 @@ def pprint(self):
678679
return u"[External] %s" % self.value
679680

680681

682+
class _UnknownInfo(StreamInfo):
683+
length = 0
684+
bitrate = 0
685+
686+
def __init__(self, fileobj):
687+
pass
688+
689+
@staticmethod
690+
def pprint():
691+
return u"Unknown format with APEv2 tag."
692+
693+
681694
class APEv2File(FileType):
682695
"""APEv2File(filething)
683696
@@ -688,16 +701,7 @@ class APEv2File(FileType):
688701
tags (`APEv2`)
689702
"""
690703

691-
class _Info(StreamInfo):
692-
length = 0
693-
bitrate = 0
694-
695-
def __init__(self, fileobj):
696-
pass
697-
698-
@staticmethod
699-
def pprint():
700-
return u"Unknown format with APEv2 tag."
704+
_Info: Type[StreamInfo] = _UnknownInfo
701705

702706
@loadfile()
703707
def load(self, filething):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dev = [
3131
"pytest~=8.2",
3232
"hypothesis>=6.50.1,<7",
3333
"flake8>=7.1.0,<8",
34-
"mypy==1.15.0",
34+
"mypy==1.18.2",
3535
"coverage>=7.2.5,<8",
3636
"setuptools>=77.0.0,<78",
3737
]

0 commit comments

Comments
 (0)