you may change checkpower s failures parameter as optional so that you do not need to pass a useless list object def checkpower measurement name  power  threshold  failures none  prefix  power if not isinrange if isinstance failures  list failures append failure 