Polymorphism the Python way

Daniel Klein danielk at aracnet.com
Tue Sep 2 08:45:57 EDT 2003


On Sun, 31 Aug 2003 09:37:00 +0200, "Michael Peuser" <mpeuser at web.de>
wrote:

>I am not sure I understand your problem. What you do is fine (though it is
>not exactly 'polymorphism'). I assume you  mean:
>     instance.getthing()
>because writing self.getthing() has unclear connotations.

Yes, sorry...'instance' (or 'object') is what I meant. :-(

It's not a problem really. I just thought there would be a better,
more elegant way to achieve polymorphism without using getters.

Daniel Klein




More information about the Python-list mailing list