Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92821

Re: Classic OOP in Python

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: Classic OOP in Python
Date 2015-06-18 14:25 +0300
Organization A noiseless patient Spider
Message-ID <87oakdz2ah.fsf@elektro.pacujo.net> (permalink)
References <23b2fae3-91d5-486b-9898-78b34bee486f@googlegroups.com> <f0c76343-7230-499c-ba30-33d7f6513503@googlegroups.com> <mlu8hh$ntr$1@speranza.aioe.org> <mailman.593.1434625694.13271.python-list@python.org>

Show all headers | View raw


Todd <toddrjen@gmail.com>:

> On Thu, Jun 18, 2015 at 1:03 PM, Fabien <fabien.maussion@gmail.com> wrote:
>> Would you consider the following kind of program "unpythonic"?
>>
>> class MovingObject(object):
>>     """Great doc about what a moving object is"""
>>
>>     def move(self):
>>         """Great doc about move"""
>>         raise NotImplementedError()
>>
>> class Dog(MovingObject):
>>     def move(self):
>>         print "Dog is moving"
>>
>> class Car(MovingObject):
>>     def move(self):
>>         print "Car is moving"
>>
>> (Disclaimer: I learned OOP with Java)
>>
>>
> I think this is what abstract base classes are for in Python.

And they can be ok as long as you're not making them into a habit.


Marko

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Classic OOP in Python "Jason P." <suscricions@gmail.com> - 2015-06-17 12:21 -0700
  Re: Classic OOP in Python Skip Montanaro <skip.montanaro@gmail.com> - 2015-06-17 14:38 -0500
  Re: Classic OOP in Python Ned Batchelder <ned@nedbatchelder.com> - 2015-06-17 12:44 -0700
    Re: Classic OOP in Python Marko Rauhamaa <marko@pacujo.net> - 2015-06-17 23:39 +0300
      Re: Classic OOP in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-17 22:07 +0100
      Re: Classic OOP in Python Ned Batchelder <ned@nedbatchelder.com> - 2015-06-17 14:14 -0700
        Re: Classic OOP in Python Laura Creighton <lac@openend.se> - 2015-06-18 00:33 +0200
          Re: Classic OOP in Python Ned Batchelder <ned@nedbatchelder.com> - 2015-06-17 15:55 -0700
        Re: Classic OOP in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-18 11:50 +0100
        Re: Classic OOP in Python Laura Creighton <lac@openend.se> - 2015-06-19 01:01 +0200
        Re: Classic OOP in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-20 23:52 +0100
        Re: Classic OOP in Python Laura Creighton <lac@openend.se> - 2015-06-21 10:26 +0200
      Re: Classic OOP in Python sohcahtoa82@gmail.com - 2015-06-17 14:33 -0700
        Re: Classic OOP in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-17 22:49 +0100
        Re: Classic OOP in Python Laura Creighton <lac@openend.se> - 2015-06-18 00:22 +0200
        Re: Classic OOP in Python Marco Buttu <marco.buttu@gmail.com> - 2015-06-18 11:00 +0200
      Re: Classic OOP in Python Laura Creighton <lac@openend.se> - 2015-06-18 00:09 +0200
      Re: Classic OOP in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-17 23:27 +0100
      Re: Classic OOP in Python Steven D'Aprano <steve@pearwood.info> - 2015-06-18 08:58 +1000
        Re: Classic OOP in Python Cousin Stanley <cousinstanley@gmail.com> - 2015-06-18 08:10 -0700
      Re: Classic OOP in Python Terry Reedy <tjreedy@udel.edu> - 2015-06-17 19:46 -0400
      Re: Classic OOP in Python Chris Angelico <rosuav@gmail.com> - 2015-06-18 10:07 +1000
      Re: Classic OOP in Python "Jason P." <suscricions@gmail.com> - 2015-06-18 04:24 -0700
    Re: Classic OOP in Python "Jason P." <suscricions@gmail.com> - 2015-06-18 04:21 -0700
      Re: Classic OOP in Python Ned Batchelder <ned@nedbatchelder.com> - 2015-06-18 04:54 -0700
    Re: Classic OOP in Python "Jason P." <suscricions@gmail.com> - 2015-06-18 04:22 -0700
  Re: Classic OOP in Python sohcahtoa82@gmail.com - 2015-06-17 14:16 -0700
    Re: Classic OOP in Python Fabien <fabien.maussion@gmail.com> - 2015-06-18 13:03 +0200
      Re: Classic OOP in Python Marko Rauhamaa <marko@pacujo.net> - 2015-06-18 14:25 +0300
      Re: Classic OOP in Python Chris Angelico <rosuav@gmail.com> - 2015-06-18 21:43 +1000

csiph-web