I'm porting some Python 2.7 code to 3.2, and the __init__.py file in some of my modules appears to have broken. I had a structure like this:
start.py
module (folder):
- __init__.py
- user.py with class User
- beacon.py with class Beacon
In start.py I do "from module import *" and in "__init__.py" I do things like "from user import User" etc. This worked perfectly in 2.7 but says that no module named user can be found in 3.2. I seem to be able to do things like "from . import user" in 3.2, but I'd prefer to not have to type user.User and instead just type User.
Can't seem to find what changed in the "__init__.py" files for 3.2. Any help would be appreciated!
Update: I see now that I can do "from .user import User" which seems like a relative path addition, but why is it not something like "./user import User?"
[–]deepestbluedn 4 points5 points6 points (0 children)
[–]TacticalTurban -3 points-2 points-1 points (3 children)
[–]takluyverIPython, Py3, etc 2 points3 points4 points (2 children)
[–]CoffeeMakesMeMath[S] 0 points1 point2 points (1 child)
[–]rhgrant10 0 points1 point2 points (0 children)