wemake-python-styleguide icon indicating copy to clipboard operation
wemake-python-styleguide copied to clipboard

False positive for WPS201 in __init__.py

Open Evgenmater opened this issue 1 month ago • 0 comments

WPS201 is reported in an __init__.py file that is used as a public module. Such modules often re-export multiple objects to provide a convenient import surface.

Example:

from myapp.infra.dtos.example_parts.example_first import ExampleFirst as ExampleFirst
from myapp.infra.dtos.example_parts.example_second import ExampleSecond as ExampleSecond

Example usage:

from myapp.infra.dtos.example import example_parts
example_parts.ExampleFirst
example_parts.ExampleSecond

Expected behavior: __init__.py acting as a public namespace module should not trigger WPS201.

Possible solutions: Exclude __init__.py from WPS201.

Evgenmater avatar Dec 10 '25 11:12 Evgenmater