Protip: Enable deprecation warnings in Python
Protip: Enable deprecation warnings in Python
Since version 2.7, Python no longer outputs anything when a deprecation warning is hit. This is a good idea if you are running apps that use Python internally as you might not care about this sort of thing. However, it's a bad idea if you are developing in Python yourself (as opposed to just using an application that was written in Python).
You can turn them back on by either (1) passing -Wd on the command line, or (2) setting the PYTHONWARNINGS environmental variable to d. In fact, this allows you to just set this option in your .bashrc (or.zshrc):
export PYTHONWARNINGS=d
Now, all your Python will warn you about deprecations, which you should care about as a developer.
§
I only discovered this myself a few days ago, but have since already stumbled upon several deprecated usages in my code.