This already exists as `warnings.DeprecationWarning` see the documentation here: https://docs.python.org/3/library/exceptions.html#DeprecationWarning
That said, the fact that this is hidden by default [as seen here]( https://docs.python.org/3/library/warnings.html).. > Base category for warnings about deprecated features when those warnings are intended for other Python developers (ignored by default, unless triggered by code in `__main__`). ..makes it almost useless for most. Going back to your original suggestion though, having some decorator similar to NodeJs `util.deprecate` (which only prints the warning once) would be very convenient and much easier detected by editors and linters.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/QTAIVDLUPXW7KHWNINLM7QACLSZZ5KFP/ Code of Conduct: http://python.org/psf/codeofconduct/