https://www.mikeash.com/pyblog/friday-qa-2011-10-28-generic-block-proxying.html