I misunderstood what validate() does. Sorry for the noise on the list. -Matt
On Thu, Oct 29, 2009 at 10:06 PM, Sharad Agarwal <[email protected]>wrote: > Matt Massie wrote: > >> In genericio.py, the _validateunion function looks like: >> >> def _validateunion(schm, object): >> for elemtype in schm.getelementtypes(): >> if validate(elemtype, object): >> return True >> return False >> >> which I think only validates the first schema in a union. Shouldn't it >> be... >> >> > No. It would validate all the schemas until one is found to be matching. > > def _validateunion(schm, object): >> for elemtype in schm.getelementtypes(): >> if not validate(elemtype, object): >> return False >> return True >> >> instead? >> >> > If none of the schema matches, even then this would return true. no ? > >> -Matt >> >> >> > >
