I didn't explain my problem, chose a terrible example. This is more what I'm trying to do:

class thingy:
  def __init__(self, athingy):
    self.basic_extract()
    if self.typeof = A
             .../...

  def basic_extract(self):
    # complicated logic to extract data out of the thingy here
    # and set a bunch of values base on the data we extract
    self.size = xxx
    self.typeof = yyy
    self.weight = zzz

  def general_method(self)
    # Method that can be used on both types of thingy

class ThingyTypeA:
  def __init__(self):
    # do some further extraction specific to type A
    further_extract()


class ThingyTypeB:
  def __init__(self):
    # do some further extraction specific to type B
    further_extract()


--
Yves.                                                  http://www.SollerS.ca/
                                                       http://blog.zioup.org/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to