Re: Subclassing datetime.date

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 18:42:29 -0300, John Bokma escribió: Sir Wilhelm the Sturdy writes: I recently attempted to subclass the datetime.date object resulting in horror and confusion, before submitting to a has-a relationship. That's all fine and dandy, but out of curiosity I'd like to know w

Re: Subclassing datetime.date

2010-02-06 Thread John Bokma
Sir Wilhelm the Sturdy writes: F> Hi all, > > I recently attempted to subclass the datetime.date object resulting in > horror and confusion, before submitting to a has-a relationship. > That's all fine and dandy, but out of curiosity I'd like to know what > I'm missing. > > I was attempting to al

Subclassing datetime.date

2010-02-06 Thread Sir Wilhelm the Sturdy
Hi all, I recently attempted to subclass the datetime.date object resulting in horror and confusion, before submitting to a has-a relationship. That's all fine and dandy, but out of curiosity I'd like to know what I'm missing. I was attempting to allow more flexible instancing of an object, like

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

Re: Error subclassing datetime.date and pickling

2007-08-02 Thread kyosohma
On Aug 2, 11:02 am, Mike Rooney <[EMAIL PROTECTED]> wrote: > Hi everyone, this is my first post to this list. I am trying to create a > subclass of datetime.date and pickle it, but I get errors on loading it > back. I have created a VERY simple demo of this: > > import datetime > > class MyDate(dat

Error subclassing datetime.date and pickling

2007-08-02 Thread Mike Rooney
Hi everyone, this is my first post to this list. I am trying to create a subclass of datetime.date and pickle it, but I get errors on loading it back. I have created a VERY simple demo of this: import datetime class MyDate(datetime.date): """ This should be pickleable. >>> md =