Python Strings

Jonadab the Unsightly One jonadab at bright.net
Tue Sep 5 07:16:17 EDT 2000


"Alex Martelli" <alex at magenta.com> wrote:

> You're thinking of 'variables' as reasonably-persistent names
> for *locations in storage* -- a la C.  Not a good mental model
> for Python's variables...

The trouble with that kind of variable is that it forces
strong typing, which is bad for those of us who prefer
type-checking to be on another continent while we're busy 
trying to write code.  I have yet to learn the language
(though I haven't learned Python yet; gearing up to do that)
which is quite as loosely typed as I want.  Inform is the
closest, but you can't always tell the difference between 
all types at runtime, which is troublesome occasionally.  
Perl is *sort of* loosely typed, but there are five or six
major non-interchangeable supertypes (array, hash, scalar, ...)
and I'd prefer looser typing than that.  Even in lisp,
a variable cannot transparently hold either a value or a
function; it can hold either, neither, or both, but you
can't substitute one for the other like you can in Inform.
There's no equivalent for PrintOrRun, nor can there be.
And, like I said, Inform has the trouble of not being
able to *distinguish* all types at run time.

So, anyway, how flexible is Python's typeing?  

- jonadab



More information about the Python-list mailing list