Language change and code breaks

Skip Montanaro skip at pobox.com
Wed Jul 11 16:38:58 EDT 2001


    Konrad> And a//b definitely beats (a+0.)/b, which does the trick, but is
    Konrad> not at all evident.

I'm not sure that the purpose of a//b would be all that evident to a new
Python programmer, especially one whose first programming language is
Python.  I've never seen // used as an operator before other than to
introduce comments in C++ and that ilk.  I suppose it means something in
APL, and I wouldn't be that surprised if it had some meaning in Perl. ;-)

At the very least C, C++ and Java programmers should be familiar with the
purpose of

    (a+0.0)/b

or

    float(a)/b

-- 
Skip Montanaro (skip at pobox.com)
(847)971-7098




More information about the Python-list mailing list