So, perhaps @omz will determine this a non-issue, but it's a peculiarity I've run into, so I figured best to report it.
I use Pythonista3 mostly with files stored in the Pythonista 2 folder because I haven't gotten around to reimplementing my DropBox sync workflow yet. Because of this unique use case I discovered an interesting bug.
If you have two separate files in the Pythonista 2 folder, where FileA imports FileB, and you make changes to FileB, and you run FileA from Pythonista3, changes to FileB are not reflected until you hard quit Pythonista, or use the importlib.reload() method.
Here are the files to reproduce this..
FileA.py
# coding: utf-8
import FileB
from FileB import *
class FileAClass(object):
def __init__(self):
self.remote = FileB.FileBClass()
if __name__ == "__main__":
local = FileAClass()
local.remote.functionB()
standaloneFunction()
FileB.py
# coding: utf-8
import time
class FileBClass():
def __init__(self):
pass
def functionB(self):
changeThisText = "aaaaaaaaaaaaa"
print("watch for changes - "+str(changeThisText))
def standaloneFunction():
phrase = "bananas"
print("changes? - "+str(phrase))
Changes to text in both the class method and standalone function in FileB.py aren't reflected in FileA until a hard reset or forced reload.