A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048781.html below:

[Python-Dev] Adding status code constants to httplib

[Python-Dev] Adding status code constants to httplib [Python-Dev] Adding status code constants to httplibPhillip J. Eby pje at telecommunity.com
Fri Sep 10 17:01:08 CEST 2004
At 12:45 PM 9/10/04 +0100, Andrew Eland wrote:
>Over in web-sig, we're discussing PEP 333, the Web Server Gateway 
>Interface. Rather than defining our own set of constants for the HTTP 
>status code integers, we thought it would be a good idea to add them to 
>httplib, allowing other applications to benefit. I've uploaded a patch[1] 
>to httplib.py and the corresponding documentation. Do people think this is 
>a good idea?

I would also put the statuses in a dictionary, such that:

     status_code[BAD_GATEWAY] = "Bad Gateway"

This could be accomplished via something like:

     status_code = dict([
        (val, key.replace('_',' ').title())
            for key,val in globals.items()
                if key==key.upper() and not key.startswith('HTTP')
                    and not key.startswith('_')
     ])

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4