问题
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