Schema error merging problem ?

"Mamoru Misono" <mamo-FWiGn6gpqjpWk0Htik3J/[email protected]>
Newsgroups gmane.comp.python.formencode
Message-ID <001501c82fc5$fb07bbf0$1501a8c0@sonosoftdell>
I think that 'Schema' class cannot merge errors from validators of
each field and errors from validators of 'chained_validators' correctly.

In '_to_python' method of 'Schema' class, validators of each field are
evaluated first. And errors is assigned to local variable 'errors' 
dictionary as instances of 'Invalid' class.

Then, validators of 'chained_validators' are evaluated and those errors
are 'unpack_errors'ed into dictionary and merged with prebious 'errors' 
dictionary by 'merge_dicts' method.

'merge_dicts' method will call 'merge_values' method.
'merge_values' method doesn't know how to merge an instance of
'Invalid' class, does know only how to merge (str, unicode), (list, tuple)
and dictionaries.

So I guess 'Schema' class never merge errors from validators of each field 
and errors from validators of 'chained_validators' correctly.

--
Mamoru


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.