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

Add a smart, lazy __all__ #1

Closed
brettcannon opened this issue Apr 20, 2018 · 2 comments
Closed

Add a smart, lazy __all__ #1

brettcannon opened this issue Apr 20, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@brettcannon
Copy link
Owner

The idea being that maintaining all is annoying, so why not automate it?

It would need to be a part of __getattr__. That probably means implementing a fall_through argument so that you can stack __getattr__ functions (e.g. this with lazy_import().

@brettcannon brettcannon added the enhancement New feature or request label Apr 20, 2018
@brettcannon
Copy link
Owner Author

Another option to a fall_through argument is to simply provide a generic AttributeError constructing function and then a helper function that simply chained together calls when AttributeError was raised. It would probably require setting an attribute attribute in order to help prevent accidental suppression of a different AttributeError.

@brettcannon
Copy link
Owner Author

Done in 182e3cc

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