[Tutor] when string,join won't work

Moshe Zadka moshez@zadka.site.co.il
Thu, 4 Jan 2001 19:08:50 +0200 (IST)


On Wed, 03 Jan 2001, "Sean 'Shaleh' Perry" <shaleh@valinux.com> wrote:

> one of the reason to use a scripting language is to get away from:

It's not PC to call Python a scripting language. "High-level interpreted
language" is the common description.
I'm only pointing that out because I think you're mixed up about what
Python *is*, as well as what Python is *called*.

> string foo;
> 
> foo = 'hello';
> 
> kind of code.  Python requiring me to know that the sequence is 100% strings is
> kind of silly in my book.

But it doesn't: ``str'' works on any type (almost). Python is strongly typed:
you can't treat a number as a string, or vice versa. I can't begin to explain
how many times it caused potentially yucky bugs into obvious ones. It
is, however, polymorphic to extremes, which is why map(str, seq) works always:
you don't need to promise what types are in seq. 

Explicit is Better then Implicit is one of the Python rules of living. Python
will stay explicit, so whether you think it's silly or not, this is an
essential feature, not a quirk.
-- 
Moshe Zadka <sig@zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!