-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: Definition of "_meta" in base class "PermissionsMixin" is incompatible with definition in base class "AbstractBaseUser" #471
Comments
@anentropic I'm not able to reproduce this bug, could you post a result of |
|
@anentropic Shouldn't you use |
importing the same class as we couldn't use |
Ok, so I'm out of ideas at this point, sorry. Maybe @sobolevn will come up with something? |
I would also love to see Thanks a lot for the help! 👍 |
if TYPE_CHECKING:
reveal_type(AuthUser._meta)
reveal_type(PermissionsMixin._meta)
reveal_type(AbstractBaseUser._meta)
|
We can try to tweak the variance of |
if you have a branch with the contravariant change at some point I'll be happy to try it out on my problem Django project |
@anentropic According to https://code.djangoproject.com/ticket/31437 (thanks to @syastrov for the link):
So, it seems like |
@kszmigiel I'm not saying it's not somehow... but it's not clear to me if that issue (about overriding fields of abstract models in multiple inheritance scenario) is related to this error presumably Django itself has the same problem since their class AbstractUser(AbstractBaseUser, PermissionsMixin):
class Meta:
verbose_name = _('user')
verbose_name_plural = _('users')
abstract = True |
Reproduced:
Output
Disabling the plugin removes the error... |
@syastrov thank you! I'll get back to this as soon as I get back home from holidays. |
Hey all, is there any update for this issue? |
After upgrading mypy to |
I'm on mypy version |
I'm having this issue to. Is there a fix? |
mypy |
I'm still having this issue too. How can we fix it? Or at least set it to ignore if you aren't going to. |
is there a workaround for this? |
Bug report
What's wrong
We have defined a custom
AuthUser
model in our project like:mypy gives an error:
(from the
class AuthUser(PermissionsMixin, AbstractBaseUser):
line)The slightly weird part is Django's
PermissionMixin
andAbstractBaseUser
both have an identicalMeta
:How is that should be
No error
System information
python
version: 3.8.3django
version: 2.2.12mypy
version: 0.782django-stubs
version: 1.5.0The text was updated successfully, but these errors were encountered: