DHI / DHI/python-package-development

Deprecations

Đang mở
#26 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
8
Fork
1
Merge trung bình
4 phút
Pull request đã merge (30 ngày)
1

Mô tả

![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)
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.