[Web-SIG] PEP 444 (aka Web3)

Roberto De Ioris roberto at unbit.it
Thu Sep 16 05:29:49 CEST 2010


> A PEP was submitted and accepted today for a WSGI successor protocol
> named Web3:
>
> http://python.org/dev/peps/pep-0444/
>
> I'd encourage other folks to suggest improvements to that spec or to
> submit a competing spec, so we can get WSGI-on-Python3 settled soon.
>
> - C
>
>

I generally like it.

About the *.file_wrapper removal, i suggest
a PSGI-like approach where 'body' can contains a File Object.

def file_app(environ):
    fd = open('/tmp/pippo.txt', 'r')
    status = b'200 OK'
    headers = [(b'Content-type', b'text/plain')]
    body = fd
    return body, status, headers


or

def file_app(environ):
    fd = open('/tmp/pippo.txt', 'r')
    status = b'200 OK'
    headers = [(b'Content-type', b'text/plain')]
    body = [b'Header', fd, b'Footer']
    return body, status, headers


(and what about returning multiple File objects ?)

By the way, congratulations for the big step forward

--
Roberto De Ioris
http://unbit.it



More information about the Web-SIG mailing list