Adding static typing to Python
Phil Mayers
p.mayers at ic.ac.uk
Tue Feb 19 06:23:00 EST 2002
In article <a4s7mq$u07$1 at news.idiom.com>, "Jim Dennis"
<jimd at vega.starshine.org> wrote:
> Of course there are limitations to this technique. For example I see
> that it's common for Pythonistas to use raise NotImplementedError for
> abstract classes. It would be nice of PyChecker could detect any time
> a concrete subclass fails to implement any of the requisite abstract
> functions. Of course it's difficult to see how this would be
> accomplished given current language features: how would we tell that a
> given abstract function is "abstract" (is defined to raise
> NotImplementedError)? how could we tell that a given subclass was
> "concrete" (final)? (Obviously we can see that any class that is used
> to instantiate an object must be concrete, though not necessarily
> "final", but that only works if we're given a whole project, otherwise
> there might be classes which are intended to be concrete but not used
> within the scope of our hypothetical scanning engine)
>
Interfaces rock. "implements" is one of the only features I would like
from Java (well, proper static methods, and *maybe* synchronous methods,
but that's it).
Possibly some kind of equivalent to "use strict;" from Perl (ptooi!)
Cheers,
Phil
More information about the Python-list
mailing list