- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
next = next(frist)
Admin
RSS has not been updated since last week. When are you going to fix it?
Remy: I raised the issue with the folks who can fix it, so hopefully soon. (I too use RSS to get everything, and if there isn't an RSS feed, it doesn't exist)
Admin
I do have to say that for all the horrible stuff we see with compiled languages, Python WTFs are way worse
Admin
Never worked at a place where the house style dictates the variable names, regardless of language?
Admin
These MoFos don't know shit about coding like the pendejo Héctor Rodríguez. Lol
Admin
RSS? That's unpossible, Remy. We here at firefox development know that nobody ever uses RSS at all, so support needs to be removed from all browsers. We are actively working to eliminate RSS everywhere!
I think there's some kind of mass delusion at work, that tens or hundreds of thousands of people just BELIEVE they are using RSS every day. It can't possibly be otherwise, because we, the Firefox developers, just couldn't possibly be so stupid as to remove an objectively useful and easily maintained RSS reader if people were actually using it, now could they?
Admin
Python may not mind...but I mind...and I own a lot of guns.
Admin
Admin
In which case the function probably doesn’t do what it’s intended to do, given that indentation matters in Python. As it is, when
valid_key()
returnsTrue
, the program will skip theif type == 'float':
part; unindenting that line (and those below it) by one level means thatif
will always be looked at.Admin
Haha, we have a right to own guns to shoot bad Python coders!! Worse than government tyranny.
Admin
The comment in the article about the indentation is probably right. This is a bug in the test which is causing it to skip validation of the valid_key() False case.
This appears to not be a test itself, but a function defined in a class to enable unit tests of that class. There are unit tests we don't see which set up instances of the object with various parameters, including ones not accessed directly in this function, and then call this function with the expected results of the tests in its arguments. valid_key() probably accesses one of these other parameters, presumably checking that a variable that has to be a float is actually a float. (And it probably has to be a float because of Python 2 integer division.)
Maybe the class is a singleton and during its initialization it sets the global_name to a value and they are checking that the right value is set? If it's not a singleton this is definitely messed up.
Admin
Is it so hard to get a Python WTF that when one happens it's a real doozy? Or are the normal WTFs just better-hidden in Python?
Admin
I'd agree, except that the class in question also has methods named
assertTrue
andassertFalse
, so it looks to me more like this is part of the testing framework itself or at least an extension thereof, and it's verifying ...um, something it gets from a server address (a remote call?) to check that its signature in some sense matches the one passed in its arguments (does it have a parametername
with a default valuevalue
and is it a float?).Which makes it more likely to be a singleton; but then why a global variable and not a property of the singleton?
Admin
Finally. My frist frist.
Admin
RSS Everywhere, not that's a plugin I could get behind. Does it advertise a feed in the ‹meta›-data? Show me that, not the page with all the ads and tracking and shit. (I've not yet found a feed that had ads in it, other than "sponsored articles" that are at least vaguely relevant.)
Admin
No, software WTFs are worse than government tyranny. The fact that this site exists proves that there are not enough privately-owned guns.
Admin
If you want to use keywords as variables, look no further than PL/1. You could call things ANYTHING, and it (might) actually sort it out. There is a terrible example of this I saw a LONG time ago, that was incomprehensible (you had to see it!).
Oh, another thing, FORTRAN has no reserved words either. Conflicts galore!
Admin
And that's why Python is evil.
Admin
Well, that's the downside of disabling telemetry everywhere. They can't see that people actually use those features.
Admin
Can we take a moment to ask why-oh-why we have production languages that don't have an explicit "end block" (end if, end loop, etc) command? I don't care if it's braces or BEGIN/END or END IF... but something that's not indentation?!?
Admin
The popularity of Python just means that it's now the go to language of choice for people wanting to write bad code.