DHI / DHI/python-package-development

Deprecations

未关闭
#26 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Jupyter Notebook
星标
8
派生
1
平均合并
4 分钟
30 天内合并 PR
1

描述

![Image](https://github.com/user-attachments/assets/7c66a9c7-b65f-4a05-9607-4ef111061f93)

https://docs.python.org/3/library/warnings.html#warnings.deprecated
*Added in version 3.13: See [PEP 702](https://peps.python.org/pep-0702/).*

```python
from warnings import deprecated

@deprecated("Use the new way instead")
def the_old_way():
print("God dag!")

def main():
print("Hello from foo!")

if __name__ == "__main__":
main()
the_old_way()
```

```bash
$ uv run mypy main.py --enable-error-code=deprecated
main.py:15: error: function main.the_old_way is deprecated: Use the new way instead [deprecated]
Found 1 error in 1 file (checked 1 source file)
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。