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
  • 14
    Can you define "didn't work"? What happened? What error message did you get? Commented Jun 29, 2009 at 10:07
  • 1
    Is this Pythonic or recommended? "Explicit is better than implicit." Commented Oct 1, 2016 at 5:28
  • 4
    Explicit is indeed better. But would you really like to address these annoying 'not found' messages everytime you add a new module. I think that if you have a package directory containing many small module-functions, then this is the nicest way to go about it. My assumptions are: 1. module are rather simple 2. you use the package for code tidiness Commented Dec 5, 2019 at 9:23
  • 1
    Note that most (all?) answers on this page will not give you autocomplete in some IDEs and give errors in some linters (they won't "know" what the module is exporting since they don't execute the code). If you're writing a public package and want good 'developer experience', I believe manually declaring what you export is the only way. Commented Aug 10, 2022 at 2:07