Re: Subclassing datetime.date does not seem to work

2008-04-25 Thread John Machin
On Apr 26, 7:43 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Rick King schrieb: > > > > > I would like to subclass datetime.date so that I can write: > > > d = date2('12312008') > > > I tried: > > > from datetime import date > > class date2(date): > > def __init__( self, strng ): > >

Re: Subclassing datetime.date does not seem to work

2008-04-25 Thread Christian Heimes
Rick King schrieb: > I would like to subclass datetime.date so that I can write: > > d = date2('12312008') > > I tried: > > from datetime import date > class date2(date): > def __init__( self, strng ): > mm,dd,yy = int(strng[:2]), int(strng[2:4]), int(strng[4:]) > date.__init

Subclassing datetime.date does not seem to work

2008-04-25 Thread Rick King
I would like to subclass datetime.date so that I can write: d = date2('12312008') I tried: from datetime import date class date2(date):     def __init__( self, strng ):     mm,dd,yy = int(strng[:2]), int(strng[2:4]), int(strng[4:])     date.__init__(self,yy,mm,dd) But then this stat