This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author demian.brecht
Recipients demian.brecht, ethan.furman, martin.panter, r.david.murray
Date 2016-02-18.23:49:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455839376.05.0.26440647337.issue26380@psf.upfronthosting.co.za>
In-reply-to
Content
> I can see the advantage of using an enum over a plain string. But you only get an error at run time, not compile time, if you misspell it.

Sure, but at least you're giving static analysis utilities the chance to catch it up front.

> And there is also the disadvantage of the extra boilerplate of importing HTTPMessage.

I guess that all depends on how you're importing your modules. If you just import "http", then there's no additional boilerplate.

> So I don’t have a strong opinion either way. Do other libraries have a similar enum?

I haven't seen enums in other libraries, only constants. I figured that it might as well be consistent with HTTPStatus, although granted, HTTPStatus does a little more than the methods.
History
Date User Action Args
2016-02-18 23:49:36demian.brechtsetrecipients: + demian.brecht, r.david.murray, ethan.furman, martin.panter
2016-02-18 23:49:36demian.brechtsetmessageid: <1455839376.05.0.26440647337.issue26380@psf.upfronthosting.co.za>
2016-02-18 23:49:36demian.brechtlinkissue26380 messages
2016-02-18 23:49:35demian.brechtcreate