我正在使用 Docker Compose 部署一些服务。我想检查我的容器是否运行正常(请参阅此处的healthcheck
Docker Compose 文档)。
让我们考虑以下代码。它工作正常,除非我取消注释最后一行:
\n# docker-compose.yml\n\nversion: "3.8"\n\nservices:\n postgres: # this is just an example, please don\'t focus on that particular image\n image: postgres:15-alpine\n healthcheck:\n test: pg_isready -d my_db -U my_user # again, the command here is not my point, nor the env, feel free to change it\n interval: 60s\n start_period: 30s\n # start_interval: 5s # \xe2\x86\x92 this line is commented because it raises an error! Why?\n
Run Code Online (Sandbox Code Playgroud)\nDockerfile 文档的此页面描述了指令中各种设置之间的差异HEALTHCHECK
。 …
2022 年 7 月发布的Visual Studio Code Python 扩展引入了“ Inlay Type Hints ”,它会自动建议没有显式注释的函数的返回类型。要启用它,您可以设置"python.analysis.inlayHints.functionReturnTypes": true
IDE 用户设置(首选项:打开设置 (JSON) 命令)。
...其中黄色突出显示的文本是 Python 扩展建议的返回类型,该扩展基于Pylance,而 Pylance 本身又依赖于Pyright。
我的问题是:@
这个建议中的标志是什么意思?是否有 PEP 引用这种类型注释(使用Self@...
),或者这种类型提示特定于Pyright
,与标准约定不同?我在哪里可以找到更多相关信息?
我在这里发现了一个类似的 Stackoverflow 问题,但没有得到任何答案。