[Web-SIG] about Py[Type]_Check in a WSGI implementation

Ian Bicking ianb at colorstudy.com
Fri Oct 19 21:02:31 CEST 2007

Manlio Perillo wrote:
> The WSGI spec requires the response headers and sequence items to be, 
> respectively, List of Tuples and Strings.
> However only for the response headers it explicitly requires them to be 
> a Python List, i.e type(response_headers) is ListType.
> What about the other objects?
> In the current implementation of WSGI for Nginx I always use 
> Py[Type]_Check, and not Py[Type]_CheckExact.

All of the types are required to be exactly as defined, not subclasses 
or None.  But servers are not required to actually test this. 
wsgiref.validate does test for exactly these types, but it's acceptable 
for Nginx to just access the data without checking its exact type.

Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org

More information about the Web-SIG mailing list