python-3.x - 注释返回文件的函数的正确方法是什么?
问题描述
我正在注释一个返回 html 文件的函数。输出的正确类型是什么?现在我正在使用“对象”,但可能它太宽泛了。
@app.route('/')
def homepage() -> object:
"""
This function loads the homepage.
:return: the homepage index.html
"""
return send_from_directory(
os.path.join(app.root_path, 'templates'),
"index.html"
)
有什么建议么?谢谢!
解决方案
推荐阅读
- c# - 如何将 C++ 结构转换为 C# 等效结构?
- scala - 如何将一组值作为环境变量提供给 typesafe/lightbend 配置?
- azure - 如何将 .pfx 文件从 azure vm 导出到 azure 门户
- python - 使用 Python 进行 Linux 静态路由规则文件格式转换
- java - 无法将通用项目实例化为列表 Java
- amazon-web-services - 使用 circleCI 在 AWS 上部署 LAMP 应用
- validation - Vue.js VeeValidate 如何阻止提交数据,直到所有数据都有效
- c# - 重构具有多个具有相同签名的方法的类
- css - 在 HTML 中使用“table-hover”类和“rowspan”的引导表不会突出显示(悬停)甚至引用其主要类别的行
- xslt-2.0 - 从 XSL 中替换/删除字符