LWN.net Logo

On the future of Perl 5

On the future of Perl 5

Posted Dec 4, 2008 14:30 UTC (Thu) by pboddie (subscriber, #50784)
In reply to: On the future of Perl 5 by niner
Parent article: On the future of Perl 5

"Explicit" as in implicit type conversion?

There are hardly any implicit conversions in Python, and certainly none between strings and numbers.

Just right now got bitten by that:
0: looks like a zero, tastes like a zero, but somewhere along the line got converted to a string and therefore it's suddenly True, not False.

My guess is that you used "print" or "str" to see the value, when you should have looked at the representation using "repr". Just evaluating the thing which provided the value in the interpreter would give you the representation.

Whoops! What happened here? "++i" is obviously legal Python code with just one unexpected effect: nothing. It just does nothing. Endless loop, here we come.

"++" is you using the unary plus operator twice, not some operator that isn't in the language: obvious if you've read even a small amount of the documentation. There are a few things about Python which could be better, even in Python 3.0, but I don't think the improvements need to come from the language in this particular instance.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds