Python anti-patterns

I’ve had Gemini 2.5 generate multiple python files in which the following anti-patterns are used. The python interpreter cannot understand this code, nor can the black formatter. Each time the code has required correction of the anti-pattern before it could function.

  • statement1; statement2 on the same line, especially where statement1 is a simple expression or pass.

  • if condition: statement1; statement2 or if condition: statement1; if condition2: …

  • except ExceptionType1: pass; except ExceptionType2: pass

  • variable = Exception() from cause