Hacker News new | past | comments | ask | show | jobs | submit login

Yes, that's the way to do it.

Python is fairly accepting with modules being either directories or files.

Going the dir/__init__.py route also allows you to do a bit of encapsulation as you can not export things.

Of course, someone could import from your file directly still. But, yeah, there is no reason to keep all of your models in a single file.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: