Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4933 closed (fixed)

django/core/xheaders.py violates PEP8 and has a typo

Reported by: Ludvig Ericson <ludvig.ericson@…> Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Call it nitpicking, but I noticed that there was a 160-byte wide line in django/core/xheaders.py and thought I'd break it up a bit and ended up rewriting 50% of the file.

Anyway, it's not very important or anything, just wanted to have the file adhere to PEP8. Feel free to ignore this (but perhaps at least fix the typo).

Did a manual regression test and I couldn't catch anything.

Attachments (1)

xheaders.py.diff (1.7 KB ) - added by Ludvig Ericson <ludvig.ericson@…> 17 years ago.

Download all attachments as: .zip

Change History (5)

by Ludvig Ericson <ludvig.ericson@…>, 17 years ago

Attachment: xheaders.py.diff added

comment:1 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

We can certainly fix the typo (good catch).

I've reformatted the if test a bit as well to break it over lines. However, the rest of the rewrite, although well-intentioned, slows down the code a bit: every time you construct a try-except block, Django has to save the current stack frame and then free it later For something that is executed for every single response, we should be a little wary of adding overhead like that. The existing code gets there without the extra work, so I prefer that.

comment:3 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5870]) Fixed #4933 -- Fixed a typo and reformatted a fairly long line in passing. Thanks, Ludvig Ericson.

comment:4 by Ludvig Ericson <ludvig.ericson@…>, 17 years ago

Good point, (and when you say Django needs to save the stack frame, I assume you mean Python? :-) I didn't know that actually.

Note: See TracTickets for help on using tickets.
Back to Top