[Bioperl-l] Re: [Bioperl-guts-l] [Bug 1742] New: GFF parser messes
attributes (fwd)
Hilmar Lapp
hlapp at gnf.org
Mon Jan 31 20:18:23 EST 2005
On Monday, January 31, 2005, at 04:56 PM, Allen Day wrote:
> This bug isn't coming from SeqFeature::Annotated, it's from the
> refactor
> of SeqFeatureI to inherit from AnnotatableI. Meaning get_tag_values()
> and
> similar functions are now get/setting attributes to a
> Bio::AnnotationColleciton store. Simple strings passed in are turned
> into
> objects when added to the store, and given back in object form.
>
> It was never specified in Bio::SeqFeatureI, even before refactoring,
> that
> the returned values of annotation tags should be strings. Code using
> the
> interface just assumed this was the case, and it wasn't a bad
> assumption
> given that Bio::SeqFeature::Generic was the only instantiable class and
> did use strings as values rather than objects.
If it wasn't a bad assumption and if everybody made that assumption,
what's so great about breaking that?
What SeqFeatureI stated was:
Title : get_tag_values
Usage : @values = $self->get_tag_values('some_tag')
Function:
Returns : An array comprising the values of the specified tag.
Args : a string
So you might say the term 'values' does not say it must be a string,
yet in the synopsis that's exactly how the method is demonstrated.
I think it's fair to say that implicitly by usage pattern the contract
has become you have to return a string here, and I think breaking this
so as to return objects may be a great idea and a great change but in a
bioperl-2.0 only.
Otherwise, you demand that all current and future Bio::AnnotationI
implementations are properly stringification-overloaded, and that
people are perfectly aware that $annvalue and "$annvalue" are two very
different things.
-hilmar
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the Bioperl-l
mailing list