Todas as publicações #2053633 Raw Editar

Mine

público text v1 · imutável
·publicado 2011-05-03 22:34 UTC
corpo renderizado da publicação
Imagine that you have the follow classes:

class Download():
  def download(self):
     print 'foo'

class Installer():
  def _fetch(self):
     print 'foo'


Both methods have the same implementation.
What is the better way in python to avoid code duplication in this case?

NOTE: You can not change the methods name in both classes.