From 35832dd79d6614e5e9e8cbe3c72c77d09510a3dc Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 29 Nov 2022 12:53:56 +0300 Subject: [PATCH 1/2] [stubtest] Add `__warningregistry__` to the list of ignored module dunders --- mypy/stubtest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index 8add8178823a..d0c2b7101410 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -1247,6 +1247,8 @@ def verify_typealias( "__author__", "__version__", "__copyright__", + # Created by `warnings.warn`, does not make much sense to have in stubs: + "__warningregistry__", } ) From 408fa9061fa81b666a0da22bd2b54076fb073006 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 29 Nov 2022 15:19:25 +0300 Subject: [PATCH 2/2] Update stubtest.py --- mypy/stubtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index d0c2b7101410..5e7f9cf331b2 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -1243,12 +1243,12 @@ def verify_typealias( "__annotations__", "__path__", # mypy adds __path__ to packages, but C packages don't have it "__getattr__", # resulting behaviour might be typed explicitly + # Created by `warnings.warn`, does not make much sense to have in stubs: + "__warningregistry__", # TODO: remove the following from this list "__author__", "__version__", "__copyright__", - # Created by `warnings.warn`, does not make much sense to have in stubs: - "__warningregistry__", } )