mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
aider: Added __all__ list to aider/editors/__init__.py to explicitly specify the exported symbols.
# Context: USER: how do i export those 2 symbols? ASSISTANT: To export the two symbols `EditBlockPrompts` and `WholeFilePrompts` from the `aider/editors/__init__.py` file, you don't need to make any changes. They are already being imported and can be used by other modules that import from `aider.editors`. For example, if you want to use these symbols in another file, you can simply import them like this: ```python from aider.editors import EditBlockPrompts, WholeFilePrompts ``` ^C KeyboardInterrupt USER: can I use __all__ ? ASSISTANT: Yes, you can use `__all__` to explicitly specify the symbols that should be imported when a client imports the module using a wildcard import (e.g., `from module import *`). To do this, add the `__all__` list to the `aider/editors/__init__.py` file and include the names of the symbols you want to export. Here's how to modify the `aider/editors/__init__.py` file: ```python aider/editors/__init__.py <<<<<<< ORIGINAL from .editblock import EditBlockPrompts from .wholefile import WholeFilePrompts ======= __all__ = ['EditBlockPrompts', 'WholeFilePrompts'] from .editblock import EditBlockPrompts from .wholefile import WholeFilePrompts >>>>>>> UPDATED ``` Now, when someone uses a wildcard import like `from aider.editors import *`, only the symbols listed in `__all__` will be imported.
This commit is contained in:
parent
03d2c73621
commit
a858d06140
1 changed files with 2 additions and 0 deletions
|
@ -1,2 +1,4 @@
|
|||
__all__ = ['EditBlockPrompts', 'WholeFilePrompts']
|
||||
|
||||
from .editblock import EditBlockPrompts
|
||||
from .wholefile import WholeFilePrompts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue