mongo
mongo copied to clipboard
Improve introspection and completion capabilities of entry point registries.
Currently there is some either unacceptable behaviour (only Registry
attributes are listed in completions) or erroneous behaviour (exceptions in REPL shells upon typing .
and triggering completion). Depending on the IDE or editor's mechanism of collecting identifiers, this will also prohibit their own symbol indexing.
Attempting tab completion (or equivalent) or performing introspection (via dir()
and friends) should list the available plugins, accounting for optional requirements.
Initial improvements are in via 79034c0. Updates include:
- Provides module-typical
__all__
attribute which is a calculated list of only the available plugin names. - Overrides
__dir__
(dir()
) behaviour to include the results of__all__
in queries.
This corrects REPL shell behaviour for ptipython
from a lengthy chain of explosions culminating in LookupError: Unknown plugin "__objclass__"; found: …
:
With:
Requires tests.