[Zope3-dev] should schema.Date accectp datetime values
Fred Drake
fdrake at gmail.com
Tue Nov 14 18:39:16 EST 2006
On 11/14/06, Bernd Dorn <zope-mailinglist at mopa.at> wrote:
> i just saw that zope.schema.Date objects accept datetime values
> because the default validate implementation uses isinstance to check
> the value. this is a problem imho, because datetime is a subclass of
> date but instances can't be compmared to each other.
Agreed.
> any problems with this? and if no, is it ok to backport it to 3.3
I don't know. It seems like a bug to me, but I'm no bastion of
backward-compatibility.
> i also tried using type instead of instance in the base
> implementation of the validate method, but this affects i18n
> messages, because they are not unicode.
The implementation is sensitive, I suppose. The patch you include
looks fine to me.
-Fred
--
Fred L. Drake, Jr. <fdrake at gmail.com>
"Every sin is the result of a collaboration." --Lucius Annaeus Seneca
More information about the Zope3-dev
mailing list