Lisp mentality vs. Python mentality

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Apr 25 03:43:21 EDT 2009


Ciprian Dorin, Craciun:
> Python way:
> ---------
> def eq (a, b) :
>     return a == b
>
> def compare (a, b, comp = eq) :
>     if len (a) != len (b) :
>         return False
>     for i in xrange (len (a)) :
>         if not comp (a[i], b[i]) :
>             return False
>     return True

That's not "pythonic".

Bye,
bearophile



More information about the Python-list mailing list