Python is DOOMED! Again!
Chris Angelico
rosuav at gmail.com
Thu Jan 22 00:56:38 EST 2015
On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole <nicholas.cole at gmail.com> wrote:
> I would have preferred Python to mimic:
>
> Define function add taking price1, the price2, print_error equals true.
> Price1 is a float. Price2 is a float. The function returns a float.
>
> But now this is sounding a little like something from Larry Wall, and so I
> had better stop!
Actually, it sounds like pre-ANSI C. Something like this:
float add(price1, price2)
float price1;
float price2;
{
... body of function ...
}
Compare the more modern C style:
float add(float price1, float price2)
{
... body of function ...
}
(I omitted print_error from both as I don't know how pre-ANSI C did
default arguments, if at all. It's possible in the modern version but
I want the comparison to be fair.)
ChrisA
More information about the Python-list
mailing list