Difference between python 2.7 and 3.3+ when importing in __init__.py and module from same directory Difference between python 2.7 and 3.3+ when importing in __init__.py and module from same directory flask flask

Difference between python 2.7 and 3.3+ when importing in __init__.py and module from same directory


There are multiple cases where Python can decide to create a new instance of an object when you re-import the module.

In fact that's not even Python 3 specific and it can happen in various scenarios.

Mainly you have to assume that the two objects may be different and work around this.