lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp

Chris Angelico rosuav at gmail.com
Fri Mar 2 02:11:29 EST 2012


On Fri, Mar 2, 2012 at 9:04 AM, Xah Lee <xahlee at gmail.com> wrote:
> One easy
> way to measure it is whether a programer can read and understand a
> program without having to delve into its idiosyncrasies.

Neither the behavior of ints nor the behavior of IEEE floating point
is a "quirk" or an "idiosyncracy". These are data types with
well-defined semantics, and you need to understand them to use them.
The fact that dividing two positive integers and producing (or casting
to) a third integer rounds the result down is just as much a part of
the definition as is two's complement negatives, which most people can
safely ignore because they "just work" the way you expect.

Learn what you're working with, if you expect to get decent results from it.

ChrisA



More information about the Python-list mailing list