Serhiy Storchaka added the comment:

How it comparing with

    return vec1[0]*vec2[0]+vec1[1]*vec2[1]+vec1[2]*vec2[2]

and

    x1, y1, z1 = vec1
    x2, y2, z2 = vec2
    return x1*x2+y1*y2+z1*z2

and

    x1, y1, z1 = vec1
    x2, y2, z2 = vec2
    return sum(a*b for a, b in zip(vec1, vec2))

?

A 5% speed up may be not enough high for cluttering the educational example.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29724>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to