Re: Selecting a different superclass

2008-12-18 Thread Jason
On Dec 18, 4:36 am, "psaff...@googlemail.com" wrote: > On 17 Dec, 20:33, "Chris Rebert" wrote: > > > superclass = TraceablePointSet if tracing else PointSet > > Perfect - many thanks. Good to know I'm absolved from evil, also ;) > > Peter Another way would be to have a factory function that buil

Re: Selecting a different superclass

2008-12-18 Thread psaff...@googlemail.com
On 17 Dec, 20:33, "Chris Rebert" wrote: > superclass = TraceablePointSet if tracing else PointSet > Perfect - many thanks. Good to know I'm absolved from evil, also ;) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Selecting a different superclass

2008-12-17 Thread Chris Rebert
On Wed, Dec 17, 2008 at 6:41 AM, psaff...@googlemail.com wrote: > This might be a pure OO question, but I'm doing it in Python so I'll > ask here. > > > The problem is that IDPointSet and MicroArrayPointSet will need to > inherit from PointSet or TraceablePointSet based on whether I'm > handling

Re: Selecting a different superclass

2008-12-17 Thread Marco Mariani
Marco Mariani wrote: I think you should investigate something different than subclassing, like a "Strategy" domain pattern or something similar. s/domain/design/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Selecting a different superclass

2008-12-17 Thread Marco Mariani
psaff...@googlemail.com wrote: The problem is that IDPointSet and MicroArrayPointSet will need to inherit from PointSet or TraceablePointSet based on whether I'm handling traceable points or not. Can I select a superclass conditionally like this in Python? Am I trying to do something really evil

Selecting a different superclass

2008-12-17 Thread psaff...@googlemail.com
This might be a pure OO question, but I'm doing it in Python so I'll ask here. I'm writing a number crunching bioinformatics application. Read lots of numbers from files; merge, median and munge; draw plots. I've found that the most critical part of this work is validation and traceability - "wher