• P (unregistered)

    next = next(frist)

  • RSS is broken (unregistered)

    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)

  • (nodebb)

    I do have to say that for all the horrible stuff we see with compiled languages, Python WTFs are way worse

  • I can be a robot if you want me to be (unregistered)

    Never worked at a place where the house style dictates the variable names, regardless of language?

  • Bill Gates (unregistered)

    These MoFos don't know shit about coding like the pendejo Héctor Rodríguez. Lol

  • FIREFOX TEAM (unregistered) in reply to RSS is broken

    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?

  • Bubba (unregistered)

    Python may not mind...but I mind...and I own a lot of guns.

  • Coyote (unregistered)
    False, True = True, False
  • (nodebb)

    It’s probably a case where they indented incorrectly, but honestly, it’s a little hard to be sure.

    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() returns True, the program will skip the if type == 'float': part; unindenting that line (and those below it) by one level means that if will always be looked at.

  • (nodebb) in reply to Bubba

    Haha, we have a right to own guns to shoot bad Python coders!! Worse than government tyranny.

  • (nodebb)

    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.

  • (nodebb) in reply to Mr. TA

    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?

  • (nodebb) in reply to devjoe

    I'd agree, except that the class in question also has methods named assertTrue and assertFalse, 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 parameter name with a default value value 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?

  • (nodebb)
    frist = 14
    self.assertEqual(self.number(), frist)

    Finally. My frist frist.

  • löchlein deluxe (unregistered) in reply to FIREFOX TEAM

    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.)

  • Boom (unregistered) in reply to Mr. TA

    No, software WTFs are worse than government tyranny. The fact that this site exists proves that there are not enough privately-owned guns.

  • (nodebb)

    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!

  • RLB (unregistered) in reply to Gurth

    In which case the function probably doesn’t do what it’s intended to do, given that indentation matters in Python.

    And that's why Python is evil.

  • D (unregistered) in reply to FIREFOX TEAM

    Well, that's the downside of disabling telemetry everywhere. They can't see that people actually use those features.

  • Milkshake (unregistered)

    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?!?

  • (nodebb)

    The popularity of Python just means that it's now the go to language of choice for people wanting to write bad code.

Leave a comment on “Answer the Questions on this Test”

Log In or post as a guest

Replying to comment #:

« Return to Article