Add support for more forms of computed `__all__`
Feature
Add typing support for the following forms of computing __all__:
__all__ += ['a', b']
__all__ += submodule.__all__
__all__.extend(submodule.__all__)
Pitch
Combining __all__ from multiple submodules is a common and useful pattern.
Related: https://github.com/python/mypy/issues/12582
What is the progress of this?
When we can expect it to be fixed? Is someone working on it? The initial setup is working, but only for 1 layer! If you add more layers, then it is breaking.
I'll also point out that @public is another common-ish way of computing __all__ and it also causes a raft of bogus attr-defined warnings. E.g.
from public import public
@public
def a_public_method():
pass
@public
class APublicClass:
pass
from foo.bar import PublicFoo, PublicBaz
# Often seen in a re-exporting __init__.py
public(
PublicFoo=PublicFoo,
PublicBar=PublicBar,
)
All of these cases are common ways to declare publicly exported names for __all__ and which are not supported by mypy.