Skip to content
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

22.3.2: Possible wrong base class for ModelManager #223

Open
mschoettle opened this issue Apr 20, 2022 · 0 comments
Open

22.3.2: Possible wrong base class for ModelManager #223

mschoettle opened this issue Apr 20, 2022 · 0 comments

Comments

@mschoettle
Copy link

mschoettle commented Apr 20, 2022

Location within the Book

  • Chapter or Appendix: 22
  • Section: 3
  • Subsection: 2
  • Example: 22.9

Description

This is a follow-up to #136. I am in the process of implementing this and I use mypy for type checking.

Defining the manager using the base class BaseUserManager resolves in the following error for the following line:

objects = InventorManager()

Incompatible types in assignment (expression has type "InventorManager[Inventor]", base class "User" defined the type as "UserManager[User]") [assignment]mypy(error)

Possible Solutions

AbstractUser actually uses UserManager so I wonder if inheriting from UserManager would not be better. At the same time, it also resolves the mypy error.

Your full name so we can provide accurate credit within the book

Matthias Schoettle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant