"no variable or argument declarations are necessary."
Diez B. Roggisch
deets at nospam.web.de
Thu Oct 6 10:35:27 EDT 2005
> Suppose we have a typesystem which has the type ANY, which would mean
> such an object could be any type. You could then have homogenous lists
> in the sense that all elements should be of the same declared type and
> at the same time mix all kind of type in a particular list, just
> as python does.
The you have JAVA Object or C void*. Which cause all kinds of runtime
troubles.... because they essentially circumvene the typechecking!
>
> So how would this limit python.
The limitation is that in static languages I must _know_ what type to
cast such an ANY, before calling anything on it. Otherwise its useless.
>>even though ususally the contents of a list
>>share some common behaviour. And that exactly is the key point here: in
>>a statically typed world, that common behaviour must have been extracted
>>and made explicit.
>
>
> Would my suggestion be classified as a statically typed world?
See above.
>
>
>>Which is the cause for that notorious java io API.
>>And, to extend the argument to ML-type type-checking, there you need a
>>disjoint union of the possible types - _beforehand_, and the code
>>dealing with it has to be aware of it.
>>
>>In python OTH, I just pass objects I like into the list - if they
>>behave, fine.
>
>
> But now we are no longer talking about how typechecking would limit
> the language but about convenience for the user.
That's dialectics. Limits in the language limit the user and make things
inconvenient.
Diez
More information about the Python-list
mailing list