logoalt Hacker News

viccisyesterday at 10:17 PM3 repliesview on HN

One Python one I hate is that it adds crazy amounts of newlines for no real readability gains.

Instead of this:

  def add_three_ints(x: int, y: int, z: int) -> int:  
      return x + y + z
it will write:

  def add_three_ints(  
      x: int,  
      y: int,  
      x: int,  
  ):  
      return x + y + z
While it's always preferable to do this when you get either long or complex function signatures, Opus 4.7 and GPT 5.5 do this everywhere. When you combine it with their penchant for writing helper functions for everything, you get a ton of vertical padding that messes up the readability imo because Python really relies on your eye seeing indents for scope.

Replies

duckmysicktoday at 9:05 AM

A code formatter like Black can handle that. It's there to enforce a single code style no matter what the contributors use, whether they are human or AI.

tomjakubowskiyesterday at 10:29 PM

The second way produces more billable output tokens. Worse, when you feed that code back into the LLM service, the extra whitespace counts as input tokens.

show 1 reply
fragmedeyesterday at 10:31 PM

That's for diffing gains later.

If you have to add arguments, when they're on one line like that, the diff is cleaner, so the reviewer has an easier time kf understanding what's going on. That is, if you still have a human reviewing code, that is.