|
From: Michael F. <ar...@vo...> - 2007-05-15 23:21:17
|
Nicola Larosa 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'm still slightly reluctant, if the entry is meant to be a list then a single entry is valid and we're debating syntax. On the other hand there *is* a potential cause for confusion - so at least an error will signal where the problem is. I think this is probably the right thing to do. There is possibly also an issue with empty values and empty lists as well. I'll look into it. Michael |