On Sat, Oct 24, 2009 at 4:49 PM, bhaskar jain <[email protected]>wrote:

> Thanks all for replying.
>
> Let me be clear,
>
> [..snip..]
>
>
> Now if we have, d = {'a':1, 'b':2}
> >>> l = d.keys().sort()
> >>> print l
> None
>
>
> d.keys() is a list  which references the keys of the dictionary.
> But the sort method does not do what is intended on this list?
>

Whoa..

x=d.keys()
x.sort()

ends up sorting the list in place. It does EXACTLY what it is documented as
doing. ie. sort the list in place and return None.
So whats the basis of  "sort method does not do what is intended on this
list" ?


> --Bhaskar.
> _______________________________________________
> BangPypers mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
--------------------------------------------------------
blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to