-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update default values for ast.ImportFrom initialization #14308
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
base: main
Are you sure you want to change the base?
Conversation
hunterhogan
commented
Jun 19, 2025
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
This comment has been minimized.
This comment has been minimized.
Reverse chronological 3.15(.venv) C:\clones\cpython>pcbuild\amd64\python_d
Python 3.15.0a0 (heads/main:28c71ee4b2e, Jun 17 2025, 22:00:57) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.ImportFrom()
ImportFrom(module=None, names=[], level=None)
>>> 3.14, not installed or compiled3.13 (also, see above)Default values(.313) C:\clones\typeshed>py
Python 3.13.5 (tags/v3.13.5:6cb20a2, Jun 11 2025, 16:15:46) [MSC v.1943 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> turkey = ast.ImportFrom()
>>> print(f"{turkey.module = }, {turkey.names = }, {turkey.level = }")
turkey.module = None, turkey.names = [], turkey.level = None
>>> ast.unparse(turkey)
'from import '
>>>
|
…rsion and enhance constructor overloads for better compatibility
This comment has been minimized.
This comment has been minimized.
Local test failuresOn my local system, I ran (.venv) C:\clones\typeshed>ver & py -V
Microsoft Windows [Version 10.0.26100.4351]
Python 3.12.10
(.venv) C:\clones\typeshed>tests\runtests.py stdlib/ast.pyi
...
Running stubtest...
c:\clones\typeshed\.venv\Scripts\python.exe -m mypy.stubtest --check-typeshed --show-traceback --custom-typeshed-dir . --allowlist stdlib\@tests\stubtest_allowlists\common.txt --allowlist stdlib\@tests\stubtest_allowlists\win32.txt --allowlist stdlib\@tests\stubtest_allowlists\py312.txt --allowlist stdlib\@tests\stubtest_allowlists\win32-py312.txt
note: unused allowlist entry _ast.ImportFrom.level
note: unused allowlist entry ast.ImportFrom.level
Found 2 errors (checked 732 modules)
That lead me to "stdlib@tests\stubtest_allowlists\common.txt" and the entries
This aspect of the testing process was unknown to me before now. I don't know if or how I should address it. GitHub actions test failuresI looked at the Window Py 3.13 test, and the GitHub test failures are the same as my local failure. ("... my local failure." That was a little too on-the-nose.) Failure is good; war is peace.Claude 4 in VS Code Copilot assured me that the test failures were a good thing.
Therefore, you're welcome.I don't know what I should do next, if anything. |
…upstream, which is mainly your origin.
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |