[Biopython-dev] [Bug 2841] SeqFeature constructor ignores qualifiers and sub_features arguments

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Jun 19 12:43:55 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2841





------- Comment #2 from biopython-bugzilla at maubp.freeserve.co.uk  2009-06-19 08:43 EST -------
See http://lists.open-bio.org/pipermail/biopython-dev/2009-June/006241.html
where Brad wrote:

> My recollection of the history here is hazy, but based on the
> code comments we were probably running into this problem without
> realizing it:
>
> http://effbot.org/pyfaq/why-are-default-values-shared-between-objects.htm
>
> It should be easy enough to allow passing in annotations and
> letter_annotations by setting the function defaults to None
> and doing the if annotations is None: annotations = {} trick.
> 
> My vote is for adding this.

I agree that would explain the comments, and fix makes sense.

Note if we want to allow the letter_annotations to be set, we
shouldn't blindly apply the supplied value (which may be a plain
dictionary, and contain inappropriate data) but make sure it is
turned into a restricted dictionary.

Ideally this should be covered with a new unit test...

Peter


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list