Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 8
    engine, sessionmaker, create_engine, and os can all also be imported from database now... seems like you've made a mess of that namespace. Commented Sep 23, 2015 at 19:28
  • 19
    @ArtOfWarfare, you can use __all__ = [...] to limit what gets imported with import *. But aside from that, yes, you're left with a messy top-level namespace. Commented Sep 23, 2015 at 23:28
  • 5
    @NathanGould you could also use single leading underscore variables which are not imported by import * by default. Eg: import os as _os and use _os inside the __init__.py module in place of os. Commented Jul 23, 2021 at 8:47
  • 3
    Also, you should NEVER do "import *". Commented Nov 13, 2022 at 9:24