[Bioperl-l] Adding empty member list in Bio::Cluster::SequenceFamily

Hilmar Lapp hlapp at gmx.net
Wed Feb 21 18:33:17 UTC 2007


Fixed in CVS HEAD. -hilmar

On Feb 21, 2007, at 8:50 AM, Samuel GRANJEAUD - IR/IFR137 wrote:

> Hello!
>
> Not clear to me, but I find a work around by checking for empty list
> before adding, here is what I noticed. Adding as members an empty list
> () is not the same as adding a reference to an empty list [], of  
> course,
> but could be thought to be the same. Calling get_members, for the  
> second
> case, I got a list of 0 member, but in the first case I got of 1  
> member,
> which is not an object at all. I am warned now, but may be the
> documentation should emphasize on using by the reference call.
>
> Best regards,
> --Samuel
>
>
> use Bio::Cluster::SequenceFamily;
>
> $f = new Bio::Cluster::SequenceFamily( -id => 'aa' );
> $f->add_members( () );
> print scalar $f->get_members();
> # 1
> $g = new Bio::Cluster::SequenceFamily( -id => 'aa' );
> $g->add_members( [] );
> print scalar $g->get_members();
> # 0
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================








More information about the Bioperl-l mailing list