3 ms·
I stopped using Python professionally for a few years myself. The biggest changes I noticed or made myself: - I used to do everything in vim, but now I adopted
by geertj 3y ago
I stopped using Python professionally for a few years myself. The biggest changes I noticed or made myself:
- I used to do everything in vim, but now I adopted VSCode (usually with SSH-Remote) and it's been such an improvement to my productivity. Try to use the integrated test explorer and debugger.
- If you use type annotations (sparingly), your VSCode experience gets even better.
- Many projects use auto formatting with 'black' these days. Initially I was a bit grossed out by this, but I now love it. It frees me up from having to spend mental cycles on complex lines, and removes the friction when reviewing CRs. The one change I make is to have a slightly longer line length.
- pyproject.toml is a new project level config file. Try to only use that file for all your setup and tool configurations
- Since you said you last touched Python 15 years ago, we now have Python 3.x. Syntax is a lot cleaner. There are many smaller differences.
- async/await is new. It is pretty neat if you want to do async programming. Don't expect a major boost (or any boost) in performance over traditional threaded code, but you can expect much cleaner code.
- f-strings are pretty neat, I use them pervasively
- I'm not sure if these are already 15 years old, but "with" context managers are the primitive to use for cleaning up resources.