#4933 closed (fixed)
django/core/xheaders.py violates PEP8 and has a typo
Reported by: | 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)
Change History (5)
by , 17 years ago
Attachment: | xheaders.py.diff added |
---|
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 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.
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.