Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Document how to set dir() to __all__ #8

Open
brettcannon opened this issue Jul 13, 2018 · 0 comments
Open

Document how to set dir() to __all__ #8

brettcannon opened this issue Jul 13, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@brettcannon
Copy link
Owner

Since using __all__ for dir() is just __dir__ = lambda: __all__, there's no need for code to handle that case. But it should at least be documented so people know that if they come looking for it. If people want common module names as well then it simply becomes __dir__ = lambda: frozenset(__all__) + modutil.COMMON_MODULE_ATTRS (once again, not complicated enough to need code, but perhaps docs to cover the idea).

Inspired by @glyph and his 'publication' project.

@brettcannon brettcannon added the enhancement New feature or request label Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant