Python Gotcha's?
Steve Howell
showell30 at yahoo.com
Thu Apr 5 11:35:37 EDT 2012
On Apr 5, 8:23 am, Iain King <iaink... at gmail.com> wrote:
> A common one used to be expecting .sort() to return, rather than mutate (as it does). Same with .reverse() - sorted and reversed have this covered, not sure how common a gotcha it is any more.
>
The sort()/sorted() variations are good to cover. To give another
example, folks who had been immersed in legacy versions of Python for
a long time might still be in the habit of hand-writing compare
functions. With newer versions of Python, it usually makes sense to
just use the "key" feature.
More information about the Python-list
mailing list