class documentation

class MIMEAccept(Accept):

View In Hierarchy

Like Accept but with special methods and behavior for mimetypes.
Property accept​_html True if this object accepts HTML.
Property accept​_json True if this object accepts JSON.
Property accept​_xhtml True if this object accepts XHTML.
Method ​_specificity Returns a tuple describing the value's specificity.
Method ​_value​_matches Check if a value matches a given accept item.

Inherited from Accept:

Method __contains__ Undocumented
Method __getitem__ Besides index lookup (getting item n) you can also pass it a string to get the quality for the item. If the item is not in the list, the returned quality is 0.
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method best​_match Returns the best match from a list of possible matches based on the specificity and quality of the client. If two items have the same quality and specificity, the one is returned that comes first.
Method find Get the position of an entry or return -1.
Method index Get the position of an entry or raise ValueError.
Method quality Returns the quality of the key.
Method to​_header Convert the header set into an HTTP header string.
Method values Iterate over all values.
Instance Variable provided Undocumented
Property best The best match as value.
Method ​_best​_single​_match Undocumented

Inherited from ImmutableListMixin (via Accept, ImmutableList):

Method __delitem__ Undocumented
Method __hash__ Undocumented
Method __iadd__ Undocumented
Method __imul__ Undocumented
Method __reduce​_ex__ Undocumented
Method __setitem__ Undocumented
Method append Undocumented
Method extend Undocumented
Method insert Undocumented
Method pop Undocumented
Method remove Undocumented
Method reverse Undocumented
Method sort Undocumented
Instance Variable ​_hash​_cache Undocumented
@property
accept_html =
True if this object accepts HTML.
@property
accept_json =
True if this object accepts JSON.
@property
accept_xhtml =
True if this object accepts XHTML.
def _specificity(self, value):
Returns a tuple describing the value's specificity.
def _value_matches(self, value, item):
Check if a value matches a given accept item.