PEP 8: update example of backslash usage for with statements by merwok · Pull Request #2244 · python/peps

If I understand correctly, this could potentially happen in any keyword statement with a syntax that incorporated commas to separate arguments that didn't explicitly allow commas:

  • return and yield statements often have commas used within them, but that's because they are used with tuples, not have multiple distinct arguments, so they work fine
  • Except statements were fixed in Python 3
  • As mentioned for with statements were formally fixed in Python 3.10, with an undocumented implementation-dependent fix in Python 3.9
  • import statements, unlike from statements, don't allow parens for continuation, but that's deliberate to not encourage users to group too many top-level imports into the same import statement, and thus would be very anti-PEP 8 anyway
  • For assert statements, this is sorta true, at least without some gymnastics, as described in and proposed to be fixed by PEP 679

I think that's everything, though I'm just a regular Pythonista and not a BDFL or FLUFL like you folks, so I could easily have missed something :)