在使用Python 3.6,Flask和PyCharm的mixin上出现意外的参数警告

时间:2020-01-06 03:17:43

标签: python flask sqlalchemy flask-sqlalchemy mixins

我正在尝试在Python 3.6中实现自定义mixin。子类将继承其方法以及基类。

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 ...}

但是,尽管我的解决方案有效,但它在PyCharm Community 2019.2中给出了一个弱警告:

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

完整的警告文本如下:

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

此警告的可能原因是什么?可能是与继承链有关的问题吗?

0 个答案:

没有答案