ietfparse/algorithms.py
def _content_type_matches(candidate, pattern):
    """Is ``candidate`` an exact match or sub-type of ``pattern``?"""
    def _wildcard_compare(type_spec, type_pattern):
        return type_pattern == '*' or type_spec == type_pattern

    return (
        _wildcard_compare(candidate.content_type, pattern.content_type) and
        _wildcard_compare(candidate.content_subtype, pattern.content_subtype)
    )
def _content_type_matches(candidate, pattern):
    """Is ``candidate`` an exact match or sub-type of ``pattern``?"""
    def _wildcard_compare(type_spec, type_pattern):
        return type_pattern == '*' or type_spec == type_pattern

    return (
        _wildcard_compare(candidate.content_type, pattern.content_type) and
        _wildcard_compare(candidate.content_subtype, pattern.content_subtype)
    )
def _content_type_matches ( candidate , pattern ) : def _wildcard_compare ( type_spec , type_pattern ) : return type_pattern == '*' or type_spec == type_pattern return ( _wildcard_compare ( candidate . content_type , pattern . content_type ) and _wildcard_compare ( candidate . content_subtype , pattern . content_subtype ) )
Is ``candidate`` an exact match or sub-type of ``pattern``?
Is candidate an exact match or sub - type of pattern ?