bpo-32030: Rewrite calculate_path() by vstinner · Pull Request #4521 · python/cpython (original) (raw)

Hi @berkerpeksag, I'm trying to restrict myself to not abuse the PEP 7. This PR is a giant refactoring patch on the very old calculate_path() code. I took this as an opportunity to "upgrade" the code to the latest coding style (so PEP 7 for C, in this case).

I think we've updated PEP 7 to make curly braces required for new code.

I understand that the PEP 7 asks to not push changes which only change the coding style. But here I modified almost all functions, so I chose to apply the PEP 7 style everywhere.

basically make git blame useless.

I'm using "git blame" very often, and I almost always hit multiple "refactoring" changes before finding what I was looking for. In fact, it's quite easy to navigate between versions of the code to go deeper and deeper.

and I don't see a reason to replace all instances of that with (...) to make them conform PEP 7.

For me, it's hard to modify code which has different coding styles. I don't know which coding style I'm supposed to use. It's also common that code is copied/pasted with the old coding style, spreading the bad coding style. For newcomers, it's also hard to guess what is the "correct" style.

That's why I'm slowly converting old code, line by line, to latest coding style.