Static typing (was Re: Java guy interested in Python)

Steve Holden sholden at holdenweb.com
Fri Mar 9 09:07:23 EST 2001


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:98ah8301ndm at news2.newsguy.com...
> "Hamish Lawson" <hamish_lawson at yahoo.co.uk> wrote in message
> news:mailman.984131592.17401.python-list at python.org...
>     [snip]
> > Wouldn't there be a hierarchy of interface types for file-like objects,
> > with some interfaces specifying more methods than others? You'd then
>
> It probably wouldn't be a hierarchy -- there is no special sense
> in which any of .read, .readline, .readlines, .xreadlines is "more
> fundamental" than any of the others (Haskell's typeclasses are the
> best way I know to express such common situations -- methods can be
> defined in a mutually recursive way in the typeclass, the types that
> are its specific instances may break the recursion any way they like,
> and client-code gets all the desirable usage convenience).
>
> > choose the interface type that specified the collection of methods that
> > you require of your passed object.
>
> Any of the 2**4-1 non-empty subsets of the above 4 may make
> sense.  Why invent 15 names for the subsets?  The collection
> of methods that you require is exactly the set of methods
> you will actually call.  Interfaces may have their uses (I'd
> LOVE a way to get Haskell typeclasses in Python!-) but this
> doesn't seem to be a particularly useful one.
>
To answer the original question (is static typing likely to make it into
Python)...

>From http://www.python.org/sigs/types-sig/

"""Recently, the types SIG has come under attack for inactivity, and in
response Paul Prescod has offered to guide the SIG towards accomplishing a
single specific goal: to develop an optional static typing system for
Python. The December 1999 archives of the SIG show the discussion that lead
to this decision."""

However, I'm not sure how active the SIG now is, since this kind of work is
well out of my current range of interests.

regards
 Steve






More information about the Python-list mailing list