On Wed, Dec 02, 2009 at 00:10 -0800, Mark Summerfield wrote: > On 1 Dec, 18:30, Lie Ryan <lie.1...@gmail.com> wrote:
> > Also, I'm not sure what this change is referring to: > > Python 2 Python 3 > > L = list(seq) L = sorted(seq) > > L.sort() > > > > L.sort is still available in python, and sorted() have been available > > since python 2. Both list.sort() and sorted() are for different purpose, > > and neither will be deprecated. What's the change here? > > The document is about idioms as well as changes. In this case both > approaches work in both versions, but it seems that there are still a > lot of people who don't know about sorted(), so I put it in to show it > as an idiom. It would be quite nice if you could mark all the Python 3 idioms that work in Python 2.X as well. This would allow readers that are still using Python 2.X and are used to the 'old way' to adapt their coding style accordingly. You could just add a little (2.X) after the idiom for example. And thanks for the nice cheat sheet! :-D -- .''`. Wolodja Wentland <wentl...@cl.uni-heidelberg.de> : :' : `. `'` 4096R/CAF14EFC `- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.asc
Description: Digital signature
-- http://mail.python.org/mailman/listinfo/python-list