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
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
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
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 ):
> >
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
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
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
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 =