Pylint 显示错误,即使有 none

Pylint shows errors even though there are none

我有一些代码如下:

from flask_sqlalchemy import SQLAlchemy

**code for initializing app**

db = SQLAlchemy()
db.init_app(app)

class course(db.Model):
    __name__ = 'course'
    course_id = db.Column(db.Integer, autoincrement= True, primary_key= True)

** more code **

当我 运行 代码和一切都按预期工作时,我没有收到任何错误,但是 pylint 抛出错误:-

Instance of 'SQLAlchemy' has no 'Column' member
Instance of 'SQLAlchemy' has no 'Integer' member
Instance of 'SQLAlchemy' has no 'String' member

有没有办法解决这些问题,因为代码中显然没有这些错误。

您应该为此使用正确的 pylint 插件:https://pypi.org/project/pylint-flask-sqlalchemy/