<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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: http://groups.google.com/group/comp.lang.python/browse_frm/thread/d5da229b0050725d/47411c8c9322821c?q=java+interface&rnum=20#47411c8c9322821c http://groups.google.com/group/comp.lang.python/browse_frm/thread/d5da229b0050725d/47411c8c9322821c?q=java+interface&rnum=20#47411c8c9322821c 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): http://www.python.org/doc/faq/general/#how-do-you-specify-and-enforce-an-interface-spec-in-python http://www.python.org/doc/faq/programming/#is-there-a-tool-to-help-find-bugs-or-perform-static-analysis Lastly, you should look into -- http://mail.python.org/mailman/listinfo/python-list