Language type systems (was: How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable)
bignose+hates-spam at benfinney.id.au
Sun Jan 6 02:25:02 CET 2008
John Nagle <nagle at animats.com> writes:
> (I'm writing as someone who's used and liked very strictly typed
> languages like Ada and Modula.
Python is strictly typed (also known as "strongly typed"
<URL:http://en.wikipedia.org/wiki/Strongly-typed>), because its
objects know exactly what type they are and won't contort themselves
into another type unless there's an explicitly defined method for
I think you mean you're accustomed to "statically-typed languages",
where names are restricted at compile-time in what values they can
refer to. This is as opposed to Python being a "dynamically-typed
language": names are not restricted in the type of object they can be
bound to, and the type of a value is determined when that value is
> Python actually does unusually well without declarations. Most
> languages that don't have declarations run into difficulties.
> Consider Basic, TCL, and Matlab, to name three rather diverse
> examples. Python managed to avoid the problems those languages
Those three diverse examples are all weakly typed languages. Since
Python is strongly-typed and dynamically-typed, this could largely
explain the difference you see in Python "doing unusually well without
declarations" compared to those languages.
\ "It is the responsibility of intellectuals to tell the truth |
`\ and expose lies." -- Noam Chomsky |
More information about the Python-list