This article makes some very good points about moving on from old constructs in Python.
I’m guilty of using some of the older methods including os
for file manipulation instead of pathlib
. Mostly this is because it’s how I learned to do it but it’s time to stop now. I’m using pathlib
from now on.
I’m a little better about some of the other points mentioned. I’ve used dataclasses
in a few different things and they work well. I could probably use the logging
more and I do sometimes just put in a quick print
statement to see some values but the proper logging
method is just better and can be left in to inform later debugging.
I fully agree with using f-strings in general. I’m trying to do this everywhere it makes sense and it really is a better way to go for 99% of my use cases.
The moral of the post is that Python changes and it’s good to keep up with the changes that make your programming easier.