[Biopython-dev] [Bug 1717] New: Fasta.Dictionary should support has_key

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Dec 8 18:40:16 EST 2004


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

           Summary: Fasta.Dictionary should support has_key
           Product: Biopython
           Version: Not Applicable
          Platform: All
        OS/Version: Windows 2000
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: biopython-bugzilla at maubp.freeserve.co.uk


The Fasta.Dictionary is designed to let a fasta file be accessed like a Python
dictionary.

With this in mind, it would be nice to support the has_key(key) method.

See also (slightly related) Bug 1716 - Fasta.Dictionary should throw KeyError
for invalid keys

----------------------------------------------------------------

Possible implementation, based on how the keys() method is implemented.  The doc
string is that used for the standard Python dictionary method:

    def has_key(self, key) :
        """D.has_key(k) -> True if D has a key k, else False
        """
        return key in self._index['id'].keys()

There may be a far more efficient way of doing this, someone with more knowledge
about Mindy may be able to help.



------- 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