throw error when Python uses method in 'or'