<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 18, 2015 at 1:03 PM, Fabien <span dir="ltr"><<a href="mailto:fabien.maussion@gmail.com" target="_blank">fabien.maussion@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/17/2015 11:16 PM, <a href="mailto:sohcahtoa82@gmail.com" target="_blank">sohcahtoa82@gmail.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You don't need interfaces with Python.  Duck typing makes that all possible.<br>
</blockquote>
<br></span>
Yes, but I also like interfaces (or in python: mimicked interfaces with NotImplementedError) for their clarity and documentation purposes.<br>
<br>
Would you consider the following kind of program "unpythonic"?<br>
<br>
class MovingObject(object):<br>
    """Great doc about what a moving object is"""<br>
<br>
    def move(self):<br>
        """Great doc about move"""<br>
        raise NotImplementedError()<br>
<br>
class Dog(MovingObject):<span class=""><br>
    def move(self):<br>
        print "Dog is moving"<br>
<br></span>
class Car(MovingObject):<span class=""><br>
    def move(self):<br>
        print "Car is moving"<br>
<br></span>
(Disclaimer: I learned OOP with Java)<span class="HOEnZb"><font color="#888888"><br>
</font></span><br></blockquote></div><br></div><div class="gmail_extra">I think this is what abstract base classes are for in Python.<br></div></div>