-
-
Notifications
You must be signed in to change notification settings - Fork 481
AssertionError when using models.Manager #373
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
Comments
I'm running into this bug too, under the same circumstances: changed a |
Yep, I'm getting the same issue here.
|
@dmwyatt @davepeck @adithyabsk Could some of you guys support me with an example code causing the bug occur, preferably together with Mypy config file and the command you're using? I'm trying to reproduce this bug but with no success so far. |
Or even with a reproduction repo 😉 |
I've experienced a similar traceback. I've created a reproduction repo: https://github.com/danifus/djstubs-reproduce Steps:
Gives me:
Let me know if you need anything else to help this along. |
Not sure if it is the minimal reproduction repo but it resembles the structure that triggered this for me |
@danifus Thanks, getting to work |
@davepeck @danifus @adithyabsk @dmwyatt Changing
to
helped 😄 You have to specify a class before using it as type hint. Let me know if it works for you. |
@kszmigiel can this be solved using |
@kszmigiel That's the workaround I'm currently using but as it is a forward reference to |
Looks to be a little related to: #344 They mention that |
Git bisect points to 1196336 as the commit that introduced this issue. |
@danifus thanks a lot for the crime scene investigation! 🚓 My wild guess that python/mypy#7071 can possibly solve this issue. |
Thanks guys! Working for me now :D |
Bug report
What's wrong
I can't seem to create a minimal example demonstrating this, but I'm getting this on one of my projects.
If I change a custom queryset to become a custom manager by changing what it inherits from and changing
objects = CustomQuerySet.as_manager()
toobjects = CustomManager()
I get the following.python
version: 3.8django
version: 3.0.6mypy
version: .770django-stubs
version: 1.5.0The text was updated successfully, but these errors were encountered: