Skip to content

Commit

Permalink
refactor: Change load_external_modules default value to None to s…
Browse files Browse the repository at this point in the history
…upport new default mode in Griffe
  • Loading branch information
pawamoy committed Jun 17, 2024
1 parent 101dc2a commit ae5896c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ More details at [Finding modules](#finding-modules).
This option allows resolving aliases (imports) to any external module.
Modules are considered external when they are not part
of the package your are injecting documentation for.
Enabling this option will tell the handler to resolve aliases recursively
Setting this option to `True` will tell the handler to resolve aliases recursively
when they are made public through the [`__all__`][__all__] variable.
By default, the handler will only resolve aliases when they point at a private sibling
of the source package, for example aliases going from `ast` to `_ast`.
Set `load_external_modules` to `False` to prevent even that.

WARNING: **Use with caution**
This can load a *lot* of modules through [Griffe],
Expand Down
4 changes: 2 additions & 2 deletions src/mkdocstrings_handlers/python/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __init__(
config_file_path: str | None = None,
paths: list[str] | None = None,
locale: str = "en",
load_external_modules: bool = False,
load_external_modules: bool | None = None,
**kwargs: Any,
) -> None:
"""Initialize the handler.
Expand Down Expand Up @@ -474,7 +474,7 @@ def get_handler(
config_file_path: str | None = None,
paths: list[str] | None = None,
locale: str = "en",
load_external_modules: bool = False,
load_external_modules: bool | None = None,
**config: Any, # noqa: ARG001
) -> PythonHandler:
"""Simply return an instance of `PythonHandler`.
Expand Down

0 comments on commit ae5896c

Please sign in to comment.