'Returns the quality of the key.
.. versionadded:: 0.6
In previous versions you had to use the item-lookup syntax
(eg: ``obj[key]`` instead of ``obj.quality(key)``)'

def quality(self, key):

    for (item, quality) in self:
        if self._value_matches(key, item):
            return quality
    return 0
