Implicit conversion to boolean in if and while statements

Chris Angelico rosuav at gmail.com
Sun Feb 10 00:04:42 EST 2013


On Sun, Feb 10, 2013 at 3:54 PM, Rick Johnson
<rantingrickjohnson at gmail.com> wrote:
> Well Chris i have wonderful news for you! Python /does/ have "homogenous arrays", and they're called, wait for it......... arrays! Imagine that!

That's not a built-in. But you were the one who complained about the
way sum() could be applied to a list that contains a non-integer;
maybe your solution is simply to ignore sum() and work with
array.array?

Nice how you can complain about Python for not having something, then
heap scorn on me for not being aware that it's there in the stdlib.
(Which, by the way, I freely admit to being less than fully familiar
with. Even less familiar with what's on PyPI.)

ChrisA



More information about the Python-list mailing list