Missing importlib re-exported top-level modules#10746
Missing importlib re-exported top-level modules#10746Avasam wants to merge 1 commit intopython:mainfrom
importlib re-exported top-level modules#10746Conversation
Avasam
commented
Sep 21, 2023
|
Diff from mypy_primer, showing the effect of this PR on open source code: kornia (https://github.com/kornia/kornia)
- kornia/testing/__init__.py:20: error: Module has no attribute "util" [attr-defined]
|
|
This definitely isn't always the case: Maybe you have something in |
|
I concur with @hauntsaninja, with the caveat that Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'machinery'Python 3.10.8 | packaged by conda-forge | (main, Nov 24 2022, 14:07:00) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
<module 'importlib.machinery' from 'C:\\Users\\alexw\\.conda\\envs\\py310\\lib\\importlib\\machinery.py'>Python 3.13.0a0 (heads/main:d4cea794a7, Sep 21 2023, 13:24:35) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
<module 'importlib.machinery' (frozen)> |
|
Hum, I came across this in pywin32 https://github.com/mhammond/pywin32/blob/main/win32/Lib/win32serviceutil.py#L20 Edit: ran |
|
I also see |
|
Smart. So I had utilmachinery``` Error processing line 3 of C:\Program Files\Python39\lib\site-packages\flake8_helper.pth:Traceback (most recent call last): Remainder of file ignored |
|
Seems like we shouldn't make this change. |