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 Jul 28, 2023
1 parent cd05ced commit 7c066f3
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 @@ -488,7 +488,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 @@ -2852,6 +2853,8 @@ __uri__ = ''
__version__ = ''

[out]
from m import __version__ as __version__

class A: ...

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

[out]
from m import __version__ as __version__

[case testAttrsClass_semanal]
import attrs
Expand Down

0 comments on commit 7c066f3

Please sign in to comment.