DHI / DHI/python-package-development
Deprecations
- Langage dominant
- Jupyter Notebook
- Étoiles
- 8
- Forks
- 1
- Merge moyen
- 4 min
- PR mergées (30 j)
- 1
Description

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)
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.