8000 refactor: Change `load_external_modules` default value to `None` to s… · thomasmarwitz/python@ae5896c · GitHub
[go: up one dir, main page]

Skip to content

Commit ae5896c

Browse files
committed
refactor: Change load_external_modules default value to None to support new default mode in Griffe
1 parent 101dc2a commit ae5896c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/usage/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ More details at [Finding modules](#finding-modules).
141141
This option allows resolving aliases (imports) to any external module.
142142
Modules are considered external when they are not part
143143
of the package your are injecting documentation for.
144-
Enabling this option will tell the handler to resolve aliases recursively
144+
Setting this option to `True` will tell the handler to resolve aliases recursively
145145
when they are made public through the [`__all__`][__all__] variable.
146+
By default, the handler will only resolve aliases when they point at a private sibling
147+
of the source package, for example aliases going from `ast` to `_ast`.
148+
Set `load_external_modules` to `False` to prevent even that.
146149

147150
WARNING: **Use with caution**
148151
This can load a *lot* of modules through [Griffe],

src/mkdocstrings_handlers/python/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def __init__(
197197
config_file_path: str | None = None,
198198
paths: list[str] | None = None,
199199
locale: str = "en",
200-
load_external_modules: bool = False,
200+
load_external_modules: bool | None = None,
201201
**kwargs: Any,
202202
) -> None:
203203
"""Initialize the handler.
@@ -474,7 +474,7 @@ def get_handler(
474474
config_file_path: str | None = None,
475475
paths: list[str] | None = None,
476476
locale: str = "en",
477-
load_external_modules: bool = False,
477+
load_external_modules: bool | None = None,
478478
**config: Any, # noqa: ARG001
479479
) -> PythonHandler:
480480
"""Simply return an instance of `PythonHandler`.

0 commit comments

Comments
 (0)
0