I think Johannes and Guillermo are both right.

My own guiding thought about __init__: Do what is needed to have an
instance that is minimally functional, i.e. not too many of its methods
will crash when used on an init'ed object.This usually means creating a
small number of attributes with sensible initial values of the right type.

class Example(object):

  def __init__(self):
    self.counter = 0
    self.data = dict()

  def __str__(self):
    return "Counter is %i" % self.counter

  def __len__(self):
    return len(self.data)



2014-05-07 8:39 GMT+02:00 Guillermo Carrasco <notifications@github.com>:

> In genologics/epp.py:
>
> > @@ -204,7 +204,6 @@ class ReadResultFiles():
> >
> >      def __init__(self, process):
> >          self.process = process
> > -        self.file = file
> >          self.shared_files = self._pars_file('SharedResultFile')
>
> I can't find any concrete examples of people saying what to do, and I
> actually think that we are overthinking this. My advice would be: Do
> something in the *init* method if is something that is going to be done
> *always* for each object, this is precisely initializing it. Otherwise
> let the user call object methods.
>
> And this is my last contribution to a never ending discussion ;-)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/SciLifeLab/genologics/pull/58/files#r12362984>
> .
>



-- 
Per Kraulis, Ph.D.
Systems Architect, Genomics, SciLifeLab, Dept Biochem Biophys, Stockholm
University
per.kraulis@scilifelab.se, +46 (0)8 5248 1465, http://www.scilifelab.se/
Visiting address: Tomtebodavägen 23A, Karolinska Institutet Science Park
Mailing address: SciLifeLab Stockholm, Box 1031, 171 21 Solna, Sweden