On Apr 29, 9:32 am, Roy Smith <[EMAIL PROTECTED]> wrote:
> The reasoning goes along the lines of, "reverse in place is an expensive
> operation, so we don't want to make it too easy for people to do".  At
> least that's the gist of what I got out of the argument the many times it
> has come up.

Except reversing a list in place isn't expensive at all.  I assume you
meant "reverse NOT in-place".

You're pretty much right but you're missing a step.  That an in-place
operation is cheaper is the main reason why reverse is destructive,
that is true.  But it returns None mostly to avoid confusing the user,
who is likely to assume that the operation is non-destructive (or
forget that it isn't).


Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to