I looked around but cannot find a clear answer to my question.
I have a very legitimate need for supporting N-versions of the same Python module.
If they are
I did some googling for "flask support multiple API versions", and found this stackoverflow post to be pretty handy.
In short, the only real difference suggested in that post vs what you've provided is that they use subdirs for each version, and each version is a module itself.
If you're able/allowed to share common functions/objects between versions, this structure might make maintaining/managing your module easier.
some_package
+--- my_module/
+--- v1_0/
+--- __init__.py
+--- some_file.py
+--- v2_0/
+--- __init__.py
+--- some_file.py
+--- __init__.py
+--- common_stuff.py
But if you cannot share things between versions, then your current idea works just fine, and is simpler.
And then you could import it like this:
import my_module.vX_Y as my_module