diff --git a/mypy/stubutil.py b/mypy/stubutil.py index 58f87a91759e0..297b323a6ede8 100644 --- a/mypy/stubutil.py +++ b/mypy/stubutil.py @@ -488,7 +488,6 @@ class BaseStubGenerator: IGNORED_DUNDERS: Final = { "__all__", "__author__", - "__version__", "__about__", "__copyright__", "__email__", diff --git a/test-data/unit/stubgen.test b/test-data/unit/stubgen.test index fda614932ca35..7eb912ec6b74a 100644 --- a/test-data/unit/stubgen.test +++ b/test-data/unit/stubgen.test @@ -273,6 +273,7 @@ __all__ = [] __author__ = '' __version__ = '' [out] +__version__: str [case testBaseClass] class A: ... @@ -2792,6 +2793,8 @@ __uri__ = '' __version__ = '' [out] +from m import __version__ as __version__ + class A: ... [case testHideDunderModuleAttributesWithAll_import] @@ -2821,6 +2824,7 @@ __uri__ = '' __version__ = '' [out] +from m import __version__ as __version__ [case testAttrsClass_semanal] import attrs