isinstance() considered harmful

Kragen Sitaker kragen at pobox.com
Thu Jan 24 17:07:05 EST 2002


Jason Orendorff writes:
> > There's also a fourth way, Stalin-style type inference,
> 
> I didn't know there was a programming language named after Stalin.
> How does it differ from Java?

Stalin is not a programming language but a compiler --- for Scheme, to
be specific.  It can often compile Scheme code into C code that runs
very nearly as fast as if you had written the program in C in the
first place, but when it doesn't, it isn't easy to figure out why.

Scheme is a purely dynamically typed language with no type
declarations, much like today's Python.

> I'll talk more about interfaces later.  My question is,
> are explicit interfaces considered harmful too?

I really like the flexibility in Python that *any* value --- with a
few exceptions --- can be of any type that implements the right
interface.  Explicit interfaces could provide this level of
flexibility, but in Java, they don't.





More information about the Python-list mailing list