HACKER Q&A
📣 _bxg1

Good sources for learning Python idioms?


I just moved from a company where I was doing exclusively JavaScript to a company where I'm writing quite a bit of Python (3) for the first time. I expected the transition to be fairly trivial since the languages have similar capabilities and limitations, but I'm learning that the idioms are quite different and I've gotten multiple points of constructive criticism on my coding style not being idiomatic Python.

What's a good (online) authority for "idiomatic Python" that I can study, instead of learning the conventions one-by-one as I get them wrong?


  👤 naragon Accepted Answer ✓
Peter Norvig has provided some good examples here: https://github.com/norvig/pytudes

In general, he has some examples of good idiomatic python on his site as well: https://norvig.com/