Skip to content

Commit bcf162a

Browse files
committed
Do not filter __version__ module attribute: it is useful in practice.
1 parent 893d428 commit bcf162a

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
@@ -489,7 +489,6 @@ class BaseStubGenerator:
489489
IGNORED_DUNDERS: Final = {
490490
"__all__",
491491
"__author__",
492-
"__version__",
493492
"__about__",
494493
"__copyright__",
495494
"__email__",

test-data/unit/stubgen.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ __all__ = []
315315
__author__ = ''
316316
__version__ = ''
317317
[out]
318+
__version__: str
318319

319320
[case testBaseClass]
320321
class A: ...
@@ -2908,6 +2909,8 @@ __uri__ = ''
29082909
__version__ = ''
29092910

29102911
[out]
2912+
from m import __version__ as __version__
2913+
29112914
class A: ...
29122915

29132916
[case testHideDunderModuleAttributesWithAll_import]
@@ -2937,6 +2940,7 @@ __uri__ = ''
29372940
__version__ = ''
29382941

29392942
[out]
2943+
from m import __version__ as __version__
29402944

29412945
[case testAttrsClass_semanal]
29422946
import attrs

0 commit comments

Comments
 (0)