Language change and code breaks

Skip Montanaro skip at pobox.com
Sun Jul 22 12:53:14 EDT 2001


>>>>> "phil" == phil hunt <philh at comuno.freeserve.co.uk> writes:

    phil> On Fri, 20 Jul 2001 11:36:18 -0700, Corran Webster <cwebster at nevada.edu> wrote:

    >> but it is useful when translating a mathematical expression like:
    >> 
    >> __ N-1   2
    >> \       n
    >> /__n=0
    >> 
    >> into a Python program.

    phil> A better translation might be:
    ...
    phil> result = sum([n*n for n in fromto(0, N-1)])

Yes, and you still use "n" and "N" as variables, which was the whole point
of Corran Webster's post.  Maintaining case sensitivity makes it easier to
translate such mathematical constructs to Python, in the sense that they use
the same names as the mathematical construct they are mimicing.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list