mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
gh-118761: Optimise import time for ast (#131953)
This commit is contained in:
parent
ad053d8d6a
commit
f20f02e6b5
6 changed files with 1168 additions and 1144 deletions
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
@ -188,6 +188,7 @@ Python/ast_opt.c @isidentical @eclips4
|
||||||
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
|
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
|
||||||
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
|
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
|
||||||
Lib/ast.py @isidentical @JelleZijlstra @eclips4
|
Lib/ast.py @isidentical @JelleZijlstra @eclips4
|
||||||
|
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4
|
||||||
Lib/test/test_ast/ @eclips4
|
Lib/test/test_ast/ @eclips4
|
||||||
|
|
||||||
# Mock
|
# Mock
|
||||||
|
|
1150
Lib/_ast_unparse.py
Normal file
1150
Lib/_ast_unparse.py
Normal file
File diff suppressed because it is too large
Load diff
1155
Lib/ast.py
1155
Lib/ast.py
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,4 @@
|
||||||
|
import _ast_unparse
|
||||||
import ast
|
import ast
|
||||||
import builtins
|
import builtins
|
||||||
import copy
|
import copy
|
||||||
|
@ -732,7 +733,7 @@ class AST_Tests(unittest.TestCase):
|
||||||
return self.__class__(self + 1)
|
return self.__class__(self + 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return self
|
return self
|
||||||
enum._test_simple_enum(_Precedence, ast._Precedence)
|
enum._test_simple_enum(_Precedence, _ast_unparse._Precedence)
|
||||||
|
|
||||||
@support.cpython_only
|
@support.cpython_only
|
||||||
@skip_wasi_stack_overflow()
|
@skip_wasi_stack_overflow()
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Improve the import time of the :mod:`ast` module by extracting the
|
||||||
|
:func:`~ast.unparse` function to a helper module.
|
1
Python/stdlib_module_names.h
generated
1
Python/stdlib_module_names.h
generated
|
@ -8,6 +8,7 @@ static const char* _Py_stdlib_module_names[] = {
|
||||||
"_android_support",
|
"_android_support",
|
||||||
"_apple_support",
|
"_apple_support",
|
||||||
"_ast",
|
"_ast",
|
||||||
|
"_ast_unparse",
|
||||||
"_asyncio",
|
"_asyncio",
|
||||||
"_bisect",
|
"_bisect",
|
||||||
"_blake2",
|
"_blake2",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue