Bools and explicitness [was Re: PyWart: The problem with "print"]

Fábio Santos fabiosantosart at gmail.com
Tue Jun 4 12:10:55 EDT 2013


On 4 Jun 2013 17:04, "Chris Angelico" <rosuav at gmail.com> wrote:
>
> On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson
> <rantingrickjohnson at gmail.com> wrote:
> > But we are really ignoring the elephant in the room. Implict
> > conversion to Boolean is just a drop in the bucket compared
> > to the constant "shell game" we are subjected to when
> > reading source code. We so naively believe that a symbol
> > named "lst" is a list object or a symbol "age" is a integer,
> > when we could be totally wrong! This is the source of many
> > subtle bugs!!!
>
> You know, if you want a language with strict type declarations and
> extreme run-time efficiency, there are some around. I think one of
> them might even be used to make the most popular Python. Give it a
> try, you might like it! There's NO WAY that you could accidentally
> pass a list to a function that's expecting a float, NO WAY to
> unexpectedly call a method on the wrong type of object. It would suit
> you perfectly!
>

I agree. I have never had this kind of issues in a dynamic language. Except
when passing stuff to Django's fields. And in JavaScript. It seems like the
thing was made to create references to `undefined`. And make them easily
convertible to numbers and strings so that our calculations mysteriously
fail when we're missing a function argument somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130604/4275d4e7/attachment.html>


More information about the Python-list mailing list