Skip to content

Commit

Permalink
Do not filter __version__ module attribute: it is useful in practice.
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Aug 3, 2023
1 parent 893d428 commit bcf162a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion mypy/stubutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ class BaseStubGenerator:
IGNORED_DUNDERS: Final = {
"__all__",
"__author__",
"__version__",
"__about__",
"__copyright__",
"__email__",
Expand Down
4 changes: 4 additions & 0 deletions test-data/unit/stubgen.test
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ __all__ = []
__author__ = ''
__version__ = ''
[out]
__version__: str

[case testBaseClass]
class A: ...
Expand Down Expand Up @@ -2908,6 +2909,8 @@ __uri__ = ''
__version__ = ''

[out]
from m import __version__ as __version__

class A: ...

[case testHideDunderModuleAttributesWithAll_import]
Expand Down Expand Up @@ -2937,6 +2940,7 @@ __uri__ = ''
__version__ = ''

[out]
from m import __version__ as __version__

[case testAttrsClass_semanal]
import attrs
Expand Down

0 comments on commit bcf162a

Please sign in to comment.