Closed NotAFile closed 8 years ago
it automatically gets garbage collected once it leaves scope
indeed, my thoughts were that would help if changed away from http
I'll get on this tomorrow
To make those comments, you go to the code view.
p
is in global scope, thus never goes out of scope. Look into how Python scoping works. I added that for a reason.
huh? not for me. Both when running the actual code (omitted for length) and the example below, p goes out of scope, and gets garbage collected
EDIT: Apparently it only drops out of scope when I run the little snippet p is created and defined. Not sure whats going on. I can't get p to be global even if I try. nevermind, I did something horrendously stupid when doing my original test if the del
is needed. Embarassing.
many other things seem to be a personal style matter, so I'll adjust them to the way you like to do things
Python only really has global scope and function scope. try
/except
, for
, with
, etc. don't create a new scope.
It's not really making it my personal style as just not changing it to your style. Things like the isinstance
check were perfectly fine already. The None in (foo, bar)
thing is arguably less clear, but also less efficient (it has to create a tuple each time then iterate over it, rather than do two hardcoded comparisons), and again is you changing it to your own style.
Edit: For the line comments, you go to Files changed, hover over a line and click the blue +
that appears. Existing comments have an Add a line note button under them.
Yes, I agree. Is there anything more I can do to get this merged? I do know about line notes.
If the things I've commented on have been sorted, then it should be good to go. I'll leave this for @iamgreaser to merge, since it's him that runs the server anyway.
no Interest? If so feel free to close!
I thought you said to hold off the merge for a bit because there was a bug.
Yeah, that was the last thing I saw on this.
Already fixed. I'm afraid I wasn't as clear as I should have been. Should have written "Fixes the blocker bug" or something along those lines.
It's not beautiful, but at least in a state I would want to work on it.
This also needs to switch to BaseHTTPServer for less not-invented-here, will open issue.