Код: Выделить всё
from mutagen import id3
def fun(arg1: str, arg2: id3.PictureType = id3.PictureType.ARTIST):
# the body of the function
Код: Выделить всё
error: Incompatible default for argument "arg2" (default has type "int", argument has type "PictureType")
Код: Выделить всё
>>> isinstance(id3.PictureType.ARTIST, id3.PictureType)
True
>>> isinstance(id3.PictureType.ARTIST, int)
True
>>> issubclass(id3.PictureType.ARTIST.__class__, int)
True
>>> inspect.getmro(id3.PictureType.ARTIST.__class__)
(mutagen.id3._specs.PictureType, int, object)
Код: Выделить всё
id3.PictureType.ARTIST
Может ли это быть связано с «особым» способом реализации id3 автором мутагена .PictureType как перечисление (см. здесь и здесь)? И если да, то есть ли способ это исправить (без повторной реализации PictureType как правильного перечисления Python)?
Подробнее здесь: https://stackoverflow.com/questions/777 ... icturetype