Python simple dict validation