Recently, I made a simple change to some matplotlib code I run on OS X (10.10; Python 2.7.6), commenting out a single line that set the backend I use
#matplotlib
Not a "bad thing". The icon appears in the dock when Python interacts with the GUI. Agg is a non-interactive backend. With agg you did not see the icon since there was no Python UI interaction.
agg