Object Not Callable, float?

Lie Ryan lie.1296 at gmail.com
Mon Nov 30 00:44:50 EST 2009


On 11/30/2009 4:20 PM, W. eWatson wrote:
> John Bokma wrote:
>> "W. eWatson" <wolftracks at invalid.com> wrote:
>>
>>> Yikes. Thanks very much. Python seems to act unlike other language in
>>> which words like float are reserved. I'll use asum.
>>
>> The problem is that there is a function sum and you creating a float sum:
>>
>> sum = 0.0
>>
>> and
>>
>> mean = sum(hist)
>>
>> even if both could exist side by side it would be very confusing IMO.
>>
>> John
> I think I understand it, but how does one prevent it from happening, or
> know it's the cause? That msg I got?
>
> I think PL/I, FORTRAN, ALGOL, etc. have reserved words.

Generally, use PyLint or similar tools; they'll warn you.



More information about the Python-list mailing list