Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] On 11/20/05, przemek drochomirecki <[EMAIL PROTECTED]> wrote: > > Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci > news:[EMAIL PROTECTED

Re: Why are there no ordered dictionaries?

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Christoph Zwerschke" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > This is probably a FAQ, but I dare to ask it nevertheless since I > haven't found a satisfying answer yet: Why isn't there an "ordered > dictionary" class at least in the standard list? Time and agai

Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Shi Mu wrote: > > > how to do with it? > > Use Ben Finney's, not Przemek's approach if the values are mutables that you > plan to modify. If that's what you are asking. > > Peter Maybe he just want to use d

Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] I have have the following code: >>> a=[3,5,8,0] >>> b={} >>> How I can i assign each item in a as the key in the dictionary b simultaneously? that is, b={3:[],5:[],8:[],0:[]} Thanks! Other solution: b.fromkeys(a,

Re: Removing duplicates from a list

2005-09-14 Thread przemek drochomirecki
> I've a list with duplicate members and I need to make each entry > unique. > > I've come up with two ways of doing it and I'd like some input on what > would be considered more pythonic (or at least best practice). > > Method 1 (the traditional approach) > > for x in mylist: > if mylist.count