Skip to content

Commit 428405e

Browse files
committed
Do not filter __version__ module attribute: it is useful in practice.
1 parent 9c055e8 commit 428405e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

mypy/stubutil.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ class BaseStubGenerator:
488488
IGNORED_DUNDERS: Final = {
489489
"__all__",
490490
"__author__",
491-
"__version__",
492491
"__about__",
493492
"__copyright__",
494493
"__email__",

test-data/unit/stubgen.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ __all__ = []
273273
__author__ = ''
274274
__version__ = ''
275275
[out]
276+
__version__: str
276277

277278
[case testBaseClass]
278279
class A: ...
@@ -2792,6 +2793,8 @@ __uri__ = ''
27922793
__version__ = ''
27932794

27942795
[out]
2796+
from m import __version__ as __version__
2797+
27952798
class A: ...
27962799

27972800
[case testHideDunderModuleAttributesWithAll_import]
@@ -2821,6 +2824,7 @@ __uri__ = ''
28212824
__version__ = ''
28222825

28232826
[out]
2827+
from m import __version__ as __version__
28242828

28252829
[case testAttrsClass_semanal]
28262830
import attrs

0 commit comments

Comments
 (0)