[Python-Dev] dateutil

Nick Coghlan ncoghlan at iinet.net.au
Mon Mar 15 23:48:24 EST 2004


Gustavo Niemeyer wrote:

>>Why don't you use "d + relativedelta(day=-1)" instead?
>>
>>Just as easy to use, better error detection, and a big precedent.
> 
> 
> Supporting this might be cool indeed. OTOH, it doesn't replace the
> current behavior. How do you get (day=30)?

day=30 is simply '30th day of the month'.

day=-2 is '2nd last day of the month'.

The negative simply means 'count from the end', as it does with Python 
indexing. This would indeed be useful, and far more obvious than 
'day=31' and relying on the 'use maximum day in month' feature.


The other question I had was why is there no absolute 'week' parameter? 
to get 'week 43', it is necessary to say 'month=1, day=1, weeks=43'.

Regards,
Nick.

-- 
Nick Coghlan               |     Brisbane, Australia
Email: ncoghlan at email.com  | Mobile: +61 409 573 268



More information about the Python-Dev mailing list