classes and interfaces

Paul McGuire ptmcg at
Tue Jun 27 14:48:57 CEST 2006

<s99999999s2003 at> wrote in message
news:1151401318.703216.288850 at
> hi
> i come from a non OO environment. now i am learning about classes. can
> i ask, in JAva, there are things like interface. eg
> public interface someinterface {
>    public somemethod ();
>    ....
>    ...
> }
> In python , how to implement interface like the above? is it just
> define a class??
> class someinterface:
>      def somemethod: blah....
> thanks

This question crops up every week or two on this list.  (This is a healthy
indicator of people looking to map their Java learnings to Python.  Some of
the best programming knowledge I've gained has come from comparing features
among different languages, and understanding their respective
purposes/strengths/shortcomings.  In this case, presence of interfaces in
Java)  Here are some recent threads that cover this topic:

Is this in the FAQ?  Hmm, these two FAQ's may be related to your question
(although you have to know what you're looking for to recognize them):

Lastly, you should look into

More information about the Python-list mailing list