Unexpected argument warning on mixin with Python 3.6, Flask, and PyCharm

夙愿已清 提交于 2021-01-05 08:39:32

问题


I'm trying to implement a custom mixin in Python 3.6. Child classes would inherit its methods as well as base class.

db = flask_sqlalchemy.SQLAlchemy()


class CustomMixin(object):
    # {... __init__ is not being explicitly called, instance and class methods go here ...}


class UserModel(CustomMixin, db.Model)
    # {... class variables, own and inherited methods go here ...}

However, although my solution works, it gives a weak warning in PyCharm Community 2019.2:

user = UserModel(class_var_1=value_1, class_var_2=value_2) # Here the warning appears

Full warning text is the following:

Unexpected argument(s)
Possible callees:
object(self: object)
object.__new__(cls: object)

What are possible reasons of this warning? Could it be an issue related to inheritance chain?

来源:https://stackoverflow.com/questions/59606289/unexpected-argument-warning-on-mixin-with-python-3-6-flask-and-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!