|
From: Arve K. <arv...@gm...> - 2007-05-15 07:41:24
|
On 5/15/07, Nicola Larosa <ni...@te...> wrote: > > Michael Foord wrote: > >> I would like this behaviour, otherwise the validation should raise an > >> error instead of silently returning a string when a list was specified > >> in the validation schema. > > > Thanks Arve - I'll look at this. Anyone else have an opinion on the > > 'raise an error or coerce to list' question ? > > I don't need to remind you the timeless lesson of the ages before us: ;-) > > "Explicit is better than implicit. > ... > Errors should never pass silently. > Unless explicitly silenced. > In the face of ambiguity, refuse the temptation to guess." > > There is an ambiguity in *meaning* here, so definitely raise an error. I don't see any big _practical_ benefit of this level of strictness, especially since this affects users (non-programmers) directly. I find it more user friendly to accept strings for single-value lists, since the only difference is a comma at the end anyhow. I'd say this behaviour amounts to the least surprise, although others may disagree. Arve |