Lisp mentality vs. Python mentality

Ciprian Dorin, Craciun ciprian.craciun at gmail.com
Sat Apr 25 09:50:50 CEST 2009


On Sat, Apr 25, 2009 at 10:43 AM,  <bearophileHUGS at lycos.com> wrote:
> 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
> --
> http://mail.python.org/mailman/listinfo/python-list

    Ok... Then what's pythonic? Please give a pythonic implementation...

    Ciprian Craciun.

    P.S.: Also, I'm tired of hearing about the pythonic way... Where
do I find a definitive description about the pythonic way? I think
that this word is used only when someone sees something that he
doesn't like, he doesn't know what he doesn't like at it, and just
goes to say its un-pythonic, without saying what would be... Wouldn't
be just easier to say "I don't know" or "I doesn't feel right to me"?



More information about the Python-list mailing list