You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two ways in which you can explicitly re-export. They are:
When you import and set the __all__ attribute in an __init__.py. pycln as far as I remember has no problem with this.
When you use the explicit re-export syntax that is supported by Mypy, which is from b import obj as obj. This signals to Mypy that you are intentionally, deliberately re-exporting this, and are permitting imports of obj through module a.
It appears that 2 is not respected by pycln. It will remove these re-exports, because they are unused. So the feature request here is that pycln respects this convention and does not remove these. I understand that these are easily silenced through the comment directives, but the ask here is to make that superfluous.
The text was updated successfully, but these errors were encountered:
Mypy will prevent users from doing implicit re-exports. So if in module
a
you dofrom b import obj
, and attempt to dofrom a import obj
elsewhere, that will error. See https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport for more context.There are two ways in which you can explicitly re-export. They are:
__all__
attribute in an__init__.py
.pycln
as far as I remember has no problem with this.from b import obj as obj
. This signals to Mypy that you are intentionally, deliberately re-exporting this, and are permitting imports ofobj
through modulea
.It appears that 2 is not respected by
pycln
. It will remove these re-exports, because they are unused. So the feature request here is thatpycln
respects this convention and does not remove these. I understand that these are easily silenced through the comment directives, but the ask here is to make that superfluous.The text was updated successfully, but these errors were encountered: