Self-managing methods for python