[ZODB-Dev] datetime types
Marius Gedminas
mgedmin at codeworks.lt
Thu May 1 11:11:00 EDT 2003
On Wed, Apr 30, 2003 at 04:08:51PM -0400, Tim Peters wrote:
> [Paolo Invernizzi]
> > The idatetime module was commited by 'ryzaja', but cannot I guess the
> > email address for asking if it's a known iussue...
> > I've read 'In prepration for the upcoming interface changes...' in the
> > latest interface/ log...
> >
> >> Python23 CVS
> >> ZODB CVS
> >> WinXP SP1
>
> > [Viktorija Zaksiene]
> > It works with Python 2.2, but apparently not with Python 2.3. It
> > will be fixed when the new interface mechanism is checked in.
>
> Python 2.3 implements the datetime module in C, and datetime.{datetime,
> date, time, timedelta, tzinfo} are implemented in C then. Zope3 has a
> workalike datetime module coded in Python, so that the same interface can be
> used in Python 2.2. datetime.{datetime, date, time, timedelta, tzinfo} are
> implemented in Python then. You can generally add new attributes to classes
> implemented in Python, but generally not to classes implemented in C.
Yes. With the current interface mechanism when you declare that a class
cls implements some interface, that information gets stored in
cls.__implements__. As demonstrated above, this does not work for
built-in types, as demonstrated above. However making it possible to
declare interfaces for built-in types is one of the explicitly stated
goals of the BetterInterfaceImplements proposal, thus this should get
fixed when that proposal is implemented.
Marius Gedminas
--
Codeworks is available for Zope consulting -- http://www.codeworks.lt/
More information about the ZODB-Dev
mailing list