It is used to replace None or object() as a sentinel

class Default()

that represents a default value. Sometimes we want to set a value to None so we cannot use None to represent the default value, and object() is hard to be typed.


According to the following RFC message body and length SHOULD NOT

def has_message_body(status)

be included in responses status 1XX, 204 and 304.


import a module or class by string path.

def import_string(module_name, package = None)


def is_atty(): -> <class 'bool'>


Checks if the given header is an Entity Header

def is_entity_header(header)


Checks if the given header is a Hop By Hop header

def is_hop_by_hop_header(header)


Removes all the entity headers present in the headers given.

def remove_entity_headers(headers, allowed = ('content-location', 'expires'))

According to RFC 2616 Section 10.3.5, Content-Location and Expires are allowed as for the "strong cache validator".

returns the headers without the entity headers