Use isinstance rather than duck-typing for checking if the callback is a partial.