3 ms·
I often hear this, but I just don't see this working in practice. A very similar example I have experience with, I've often worked with people who tried to wri
by pfranz 7y ago
I often hear this, but I just don't see this working in practice. A very similar example I have experience with, I've often worked with people who tried to write code that would be "compatible with Windows" (I primary work in a Linux environment). It makes the code more difficult to read and as soon as you try and run it in Windows it fails spectacularly.
You can write code that's compatible with both Python 2 and 3, but I don't think you can expect to be using Python 2 exclusively and write code that works well in Python 3 unless you're constantly running it with Python 3. Especially, if you don't have much firsthand Python 3 experience. This is much easier if your code is isolated from those dependencies and you write tests that run in both Python 2 and 3, but that's quite a bit more of a commitment than you seem to be implying.
- ensignavenger 7y agoThere are a ton of open source projects that have done python 2/3 simultaneously in practice. I get your point though about not being able to run full integration tests due to dependencies. Still, if you were making a good effort to keep the code Python 3 compliant, it would make upgrading much easier. Also, my other suggestion- contributing to Python 3 compatibility for modules you depend on! That will give you Python 3 experience :)