Re: using datetime containers

2008-11-08 Thread Arnaud Delobelle
indika <[EMAIL PROTECTED]> writes: > while trying out the sorting method i realized that u can *never* > insert the sorted data to dict !!! m1 > {datetime.date(2008, 1, 1): 'b', datetime.date(2008, 1, 3): 'c', > datetime.date(2008, 1, 2): 'a'} > l = sorted(m1.items(), cmp=cmpr) // cmpr i

Re: using datetime containers

2008-11-08 Thread indika
indika wrote: > Marc 'BlackJack' Rintsch wrote: > > On Sat, 08 Nov 2008 08:07:15 -0800, indika wrote: > > > > > John Machin wrote: > > >> On Nov 8, 6:06�pm, indika <[EMAIL PROTECTED]> wrote: > > >> > Or else, I would have expected the datatime.date object has a > > >> > writeable data member, so

Re: using datetime containers

2008-11-08 Thread indika
Marc 'BlackJack' Rintsch wrote: > On Sat, 08 Nov 2008 08:07:15 -0800, indika wrote: > > > John Machin wrote: > >> On Nov 8, 6:06�pm, indika <[EMAIL PROTECTED]> wrote: > >> > Or else, I would have expected the datatime.date object has a > >> > writeable data member, so that iterating a calender wi

Re: using datetime containers

2008-11-08 Thread Marc 'BlackJack' Rintsch
On Sat, 08 Nov 2008 08:07:15 -0800, indika wrote: > John Machin wrote: >> On Nov 8, 6:06�pm, indika <[EMAIL PROTECTED]> wrote: >> > Or else, I would have expected the datatime.date object has a >> > writeable data member, so that iterating a calender with >> > itermonthdates would allow me to acce

Re: using datetime containers

2008-11-08 Thread Peter Otten
indika wrote: > Hi, > I'm a newbie to python but have some experience in programming. > I came across this requirement of using datetime.date objects > associated with some another object. > eg. a dictionary containing datetime.date => string >>> > { > datetime.date(2001, 12, 3): 'c', > datetime.d

Re: using datetime containers

2008-11-08 Thread indika
John Machin wrote: > On Nov 8, 6:06�pm, indika <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm a newbie to python but have some experience in programming. > > So work through the Python tutorial, to find out how it all hangs > together ... this will be much better than trying to translate > snippets o

Re: using datetime containers

2008-11-08 Thread John Machin
On Nov 8, 6:06 pm, indika <[EMAIL PROTECTED]> wrote: > Hi, > I'm a newbie to python but have some experience in programming. So work through the Python tutorial, to find out how it all hangs together ... this will be much better than trying to translate snippets of language X into Python. > I ca

using datetime containers

2008-11-07 Thread indika
Hi, I'm a newbie to python but have some experience in programming. I came across this requirement of using datetime.date objects associated with some another object. eg. a dictionary containing datetime.date => string >> { datetime.date(2001, 12, 3): 'c', datetime.date(2001, 12, 1): 'a', datetime.