1. 10 Sep, 2019 5 commits
    • Jeroen Demeyer's avatar
      5b00dd8f
    • Nikhil's avatar
      80428ed4
    • Greg Price's avatar
      Cut tricky `goto` that isn't needed, in _PyBytes_DecodeEscape. (GH-15825) · 0711642e
      Greg Price authored
      This is the sort of `goto` that requires the reader to stare hard at
      the code to unpick what it's doing.
      
      On doing so, the answer is... not very much!
      
      * It jumps from the bottom of the loop to almost the top; the effect
        is to bypass the loop condition `s < end` and also the
        `if`-condition `*s != '\\'`, acting as if both are true.
      
      * We've just decremented `s`, after incrementing it in the `switch`
        condition.  So it has the same value as when `s == end` failed.
        Before that was another increment... and before that we had
        `s < end`.  So `s < end` true, then increment, then `s == end`
        false... that means `s < end` is still true.
      
      * Also this means `s` points to the same character as it did for the
        `switch` condition.  And there was a `case '\\'`, which we didn't
        hit -- so `*s != '\\'` is also true.
      
      * That means this has no effect on the behavior!  The most it might do
        is an optimization -- we get to skip those two checks, because (as
        just proven above) we know they're true.
      
      * But gosh, this is the *invalid escape sequence* path.  This does not
        seem like the kind of code path that calls for extreme optimization
        tricks.
      
      So, take the `goto` and the label out.
      
      Perhaps the compiler will notice the exact same facts we showed above,
      and generate identical code.  Or perhaps it won't!  That'll be OK.
      
      But then, crucially, if some future edit to this loop causes the
      reasoning above to *stop* holding true... the compiler will adjust
      this jump accordingly.  One of us fallible humans might not.
      0711642e
    • Vinay Sharma's avatar
    • Terry Jan Reedy's avatar
      bpo-38077: IDLE no longer adds 'argv' to the user namespace (GH-15818) · c59295a1
      Terry Jan Reedy authored
      This only happened when initializing the subprocess to run a module.
      This recent bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
      c59295a1
  2. 09 Sep, 2019 35 commits