Skip to content

Clarify implicit_reexport with strict mode#21704

Open
ahmojo wants to merge 2 commits into
python:masterfrom
ahmojo:fix/16971-implicit-reexport-docs
Open

Clarify implicit_reexport with strict mode#21704
ahmojo wants to merge 2 commits into
python:masterfrom
ahmojo:fix/16971-implicit-reexport-docs

Conversation

@ahmojo

@ahmojo ahmojo commented Jul 8, 2026

Copy link
Copy Markdown

Fixes #16971.

Summary

Clarifies that implicit_reexport is enabled by default in normal configuration, but strict enables --no-implicit-reexport unless users explicitly set implicit_reexport = true.

Why

The implementation default is still implicit_reexport = true, but users running with strict = true can observe behavior equivalent to implicit_reexport = false. This keeps the existing behavior and documents the strict-mode interaction near the config option.

Validation

  • Local two-file repro: default behavior allows implicit reexport.
  • Local two-file repro: --strict reports [attr-defined] for the implicit reexport.
  • Local config repro: strict = true reports [attr-defined].
  • Local config repro: strict = true plus implicit_reexport = true passes.
  • sphinx-build -b html ... against a copied docs source tree succeeded; it emitted existing changelog toctree warnings.

@ahmojo ahmojo marked this pull request as ready for review July 8, 2026 16:33
Comment thread docs/source/config_file.rst Outdated
Although this option is enabled by default, :confval:`strict` enables
:option:`mypy --no-implicit-reexport`. Set ``implicit_reexport = true``
explicitly if you want to keep implicit reexports when using strict mode.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this paragraph to be after the example code block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implicit_reexport default seems to be wrong

2 participants