27‑inch iMac 2017 i5 vs. i7
Software development tends to be a very CPU-centric task, but the question is whether or not a few extra GHz is going to buy you significant enough longevity to stave off your next computer purchase by any significant amount. I somehow doubt it. I'd go for the 3.8GHz i5.

...or at least I would, but you mentioned Python. Python is one of the slowest of the various interpreted languages commonly used. It can use all the help it can get. If you do a significant amount of Python coding, I'd go for the faster processor.