[Biopython-dev] [Biopython] Subclassing Seq and SeqRecord

Jose Blanca jblanca at btc.upv.es
Tue Nov 24 16:17:55 UTC 2009


On Tuesday 24 November 2009 16:52:25 Peter wrote:
> Thinking about use-cases, sometimes a subclass will want the
> methods to return Seq objects, sometimes the same class.
>
> The UnknownSeq too sometimes can return another UnknownSeq,
> but must often return a Seq object.

I'm thinking about that and I don't think it's a problem. If the subclass 
wants to return as the parent class it can chose to do it. I'm just proposing 
to change the behaviour of the parent class.

> The BioSQL DBSeq on the other hand always returns a Seq
> object for all its methods. The fact that the Seq __add__ and
> __addr__ use __class__ was the cause of a bug in that adding
> DBSeq objects didn't work.

I haven't realized that problem. Was that a bug of the BioSQL project that 
could be solved or a desing problem related to my proposal?
Regards,

-- 
Jose M. Blanca Postigo
Instituto Universitario de Conservacion y
Mejora de la Agrodiversidad Valenciana (COMAV)
Universidad Politecnica de Valencia (UPV)
Edificio CPI (Ciudad Politecnica de la Innovacion), 8E
46022 Valencia (SPAIN)
Tlf.:+34-96-3877000 (ext 88473)



More information about the Biopython-dev mailing list