TL;DR
If you switch back-and-forth between 3.6.6 and 3.7.0 before you adopt 3.7.0, there is no concern, the two sets of pyc files will cohabit and you'll be ok.
What if you switch back-and-forth between 3.6.4 and 3.6.6? Do you need to delete pyc files?
Long version
I see that the pyc files are specific for major releases only. For example I have:
__init__.cpython-36.pyc
__init__.cpython-37.pyc
which is presumably the result of PEP 3147.
And so it's clear enough. If I move back-and-forth during development between virtual environments in, say, 3.6.6 and 3.7.0, there is no concern. The two versions will cohabit in the __pycache__
directory because they are identified by the major version number.
Question: What about switching back-and-forth between, say, 3.6.4 and 3.6.6, do I indeed need to delete pyc files when switching from one version and another within the same major release?
Motivation for the question
The reason that I needed to switch virtual environments is that I thought that my code runs fine with some versions of Python 3, but not others. I was getting a multitude of
ImportError: No module named XYZ
errors.
But when I wipe out all pyc files and install one version of Python or another, set up a virtual environment
~/venv-362
~/venv-364
~/venv-366
~/venv-370
then all is well and the code runs fine.