-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Delete object.__module__
#8789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Delete object.__module__
#8789
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An alternative approach to #8787
Hmm, 1868 stubtest errors |
Diff from mypy_primer, showing the effect of this PR on open source code: yarl (https://github.com/aio-libs/yarl)
+ yarl/_url.py:19: error: "object" has no attribute "__module__" [attr-defined]
SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ devtools/core.py:193: error: "partial[Coroutine[Any, Any, Any]]" has no attribute "__module__"
streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/legacy_caching/hashing.py: note: In member "_to_bytes" of class "_CodeHasher":
+ lib/streamlit/runtime/legacy_caching/hashing.py:625:16: error: Item "MethodType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:625:16: error: Item "BuiltinFunctionType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:625:16: error: Item "WrapperDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:625:16: error: Item "MethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:625:16: error: Item "ClassMethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:628:49: error: Item "MethodType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:628:49: error: Item "BuiltinFunctionType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:628:49: error: Item "WrapperDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:628:49: error: Item "MethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:628:49: error: Item "ClassMethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:642:32: error: Item "MethodType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:642:32: error: Item "BuiltinFunctionType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:642:32: error: Item "WrapperDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:642:32: error: Item "MethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
+ lib/streamlit/runtime/legacy_caching/hashing.py:642:32: error: Item "ClassMethodDescriptorType" of "Union[FunctionType, FunctionType, MethodType, BuiltinFunctionType, BuiltinFunctionType, WrapperDescriptorType, MethodDescriptorType, ClassMethodDescriptorType]" has no attribute "__module__" [union-attr]
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/core/property/enum.py: note: In function "_sphinx_type":
+ src/bokeh/core/property/enum.py:105:28: error: "Enumeration" has no attribute "__module__" [attr-defined]
core (https://github.com/home-assistant/core)
+ homeassistant/helpers/deprecation.py:39: error: "_ObjectT" has no attribute "__module__" [attr-defined]
+ homeassistant/components/smartthings/__init__.py:290: error: "DeviceBroker" has no attribute "__module__" [attr-defined]
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/http/request/__init__.py:191: error: "Request" has no attribute "__module__"
rich (https://github.com/Textualize/rich)
+ rich/console.py:946: error: "TextIO" has no attribute "__module__" [attr-defined]
discord.py (https://github.com/Rapptz/discord.py)
+ discord/ext/commands/bot.py:888: error: "Cog" has no attribute "__module__"
mypy (https://github.com/python/mypy)
+ mypy/test/teststubgen.py:1046: error: "StubgencSuite" has no attribute "__module__" [attr-defined]
+ mypy/test/teststubgen.py:1093: error: "StubgencSuite" has no attribute "__module__" [attr-defined]
alerta (https://github.com/alerta/alerta)
+ alerta/webhooks/__init__.py:33: error: "WebhookBase" has no attribute "__module__"
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/typing.py: note: In function "stringify":
+ sphinx/util/typing.py:359:13: error: "TypeVar" has no attribute "__module__" [attr-defined]
+ sphinx/util/typing.py:363:42: error: "TypeVar" has no attribute "__module__" [attr-defined]
+ sphinx/util/nodes.py: note: In function "get_full_module_name":
+ sphinx/util/nodes.py:91:27: error: "Node" has no attribute "__module__" [attr-defined]
pytest (https://github.com/pytest-dev/pytest)
+ testing/test_warning_types.py:20: error: "UserWarning" has no attribute "__module__" [attr-defined]
+ testing/test_config.py:1294: error: "My" has no attribute "__module__" [attr-defined]
antidote (https://github.com/Finistere/antidote)
+ src/antidote/_internal/utils.py:77: error: Item "MethodType" of "Union[type, FunctionType, MethodType]" has no attribute "__module__"
+ src/antidote/_internal/utils.py:78: error: Item "MethodType" of "Union[type, FunctionType, MethodType]" has no attribute "__module__"
|
Seems like mypy struggles to infer that the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An alternative approach to #8787