General Python utilities