Skip to content

Commit 7c066f3

Browse files
committed
Do not filter __version__ module attribute: it is useful in practice.
1 parent cd05ced commit 7c066f3

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
@@ -315,6 +315,7 @@ __all__ = []
315315
__author__ = ''
316316
__version__ = ''
317317
[out]
318+
__version__: str
318319

319320
[case testBaseClass]
320321
class A: ...
@@ -2852,6 +2853,8 @@ __uri__ = ''
28522853
__version__ = ''
28532854

28542855
[out]
2856+
from m import __version__ as __version__
2857+
28552858
class A: ...
28562859

28572860
[case testHideDunderModuleAttributesWithAll_import]
@@ -2881,6 +2884,7 @@ __uri__ = ''
28812884
__version__ = ''
28822885

28832886
[out]
2887+
from m import __version__ as __version__
28842888

28852889
[case testAttrsClass_semanal]
28862890
import attrs

0 commit comments

Comments
 (0)