Miki escreveu:
> Hello Paulo,
> 
>> What's wrong with this way of subclassing?
>> ...
> See  
> http://sourceforge.net/tracker/index.php?func=detail&aid=1448640&group_id=5470&atid=105470
> 
> HTH,
> --
> Miki <[EMAIL PROTECTED]>
> http://pythonwise.blogspot.com
> 

Thanks!
It works this way:

class MyDate(date):
        def __new__(cls,year,month=None,day=None):
                if type(year) is str:
                        # The whole date is here as a string
                        year,month,day=map(int,string.split(year,'-'))
                if year<100:
                        year+=2000
                return date.__new__(cls,year,month,day)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to