Ryan Ryan - 2 months ago 28
Python Question

Python namespaced class module directory layout

I want to create a

module which is namespaced
, and currently use the directory structure

example\__init__.py (Empty file)
example\user.py (Define the class `User`)

And in other file I import via

from example.user import User

It works, but I want to double check if it is the the Pythonic Way to do it.



Your approach is good and 100% Pythonic. Just make sure that you have proper comments in the modules you make.

You can refer this link for more information.