You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GenericViewSet uses UsesQuerySet which is a Protocol, whose metaclass is ABCMeta, but during runtime type(GenericViewSet) is actually type
Using ABCMeta as base in custom metaclass fixes the issue, which is mostly fine although not entirely "correct".
I guess using protocols is more helpful than just satisfying an edge metaclass case. There seems to be some work in progress in mypy that might fix this issue, in the meantime, I wanted to open this issue here so that other people could see the cause & possible fix.
The text was updated successfully, but these errors were encountered:
When using a custom metaclass with
GenericViewSet
will create "metaclass conflict" error. This seems to be due to some issue in mypy:python/mypy#15040
GenericViewSet
usesUsesQuerySet
which is aProtocol
, whose metaclass isABCMeta
, but during runtimetype(GenericViewSet)
is actuallytype
Using
ABCMeta
as base in custom metaclass fixes the issue, which is mostly fine although not entirely "correct".I guess using protocols is more helpful than just satisfying an edge metaclass case. There seems to be some work in progress in mypy that might fix this issue, in the meantime, I wanted to open this issue here so that other people could see the cause & possible fix.
The text was updated successfully, but these errors were encountered: