Skip to content

Commit

Permalink
feat: add ape to console namespace (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
delaaxe committed Aug 25, 2022
1 parent 4d27762 commit bac1928
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/userguides/console.md
Expand Up @@ -21,6 +21,7 @@ Your console comes with pre-initialized root ape objects in your namespace.
| `project` | [ProjectManager](../methoddocs/managers.html?highlight=project#module-ape.managers.project.manager) |
| `query` | [QueryManager](../methoddocs/managers.html?highlight=query#module-ape.managers.query) |
| `convert` | [convert](../methoddocs/managers.html?highlight=query#ape.managers.converters.AddressAPIConverter.convert) |
| `ape` | [ape](../methoddocs/ape.html) |

You can access them as if they are already initialized:

Expand Down
1 change: 1 addition & 0 deletions src/ape_console/_cli.py
Expand Up @@ -113,6 +113,7 @@ def console(project=None, verbose=None, extra_locals=None):
faulthandler.enable() # NOTE: In case we segfault

namespace = {component: getattr(ape, component) for component in ape.__all__}
namespace["ape"] = ape

if extra_locals:
namespace.update(extra_locals)
Expand Down

0 comments on commit bac1928

Please sign in to comment.