GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-43244: Remove PyAST_Validate() function by vstinner · Pull Request #24911 · python/cpython Conversation
|
|
See also PR #24910 "Remove symtable.h header file". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| * Removed ``PyAST_Validate()`` function. | |
| * Removed the ``PyAST_Validate()`` function from the public API as the AST symbols are no longer exposed. There is no replacement for this function. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@pablogsal @lysnikolaou @gvanrossum @isidentical: Would you be ok to remove the I failed to find any user of it. A GitHub code search for I don't think that the low-level AST C API must be used outside CPython. My plan is to move the whole In Python, you can validate an AST using compile() which calls If you have doubt and prefer to stil expose the function, we can export it but I would prefer to still rename it. Note: PyAST_Validate() is excluded from the limited C API (PEP 384). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Remove ``PyAST_Validate()`` function. Patch by Victor Stinner. | |
| Remove the ``PyAST_Validate()`` function from the public API as the AST symbols are no longer exposed. There is no replacement for this function. Patch by Victor Stinner. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes, the ast symbols are not exposed anymore so this function cannot be used without magical cast to In 3.8: in 3.9+: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
test_peg_generator fails. I'm working on a fix: PR #24912 defines also Py_BUILD_CORE macro in test_peg_generator. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I searched A single package contains |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Remove the PyAST_Validate() function. It is no longer possible to build a AST object (mod_ty type) with the public C API. The function was already excluded from the limited C API (PEP 384). Rename PyAST_Validate() function to _PyAST_Validate(), move it to the internal C API, and don't export it anymore (replace PyAPI_FUNC with extern). The function was added in bpo-12575 by the commit 832bfe2.
|
|
||
| * Remove the ``PyAST_Validate()`` function. It is no longer possible to build a | ||
| AST object (``mod_ty`` type) with the public C API. The function was already | ||
| excluded from the limited C API (:pep:`384`). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hm, pep-384 doesn't mention the ast.h. Can we move the capi directly when this C API is not a limited C API?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I just mentioned PEP 384 to explain what is the limited C API.
PyAST_Validate() definition is inside:
#ifndef Py_LIMITED_API
...
#endif /* !Py_LIMITED_API */
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Can we move the capi directly when this C API is not a limited C API?" No. I only removed the function since it cannot be used anymore since Python 3.10: " It is no longer possible to build a AST object (mod_ty type) with the public C API."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
OK, Thanks. got it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Pablo approved my PR. I failed to find usage of this function in GitHub code search and in the PyPI top 4000 packages. So I was confident enough to merge this PR. Thanks for the review Pablo. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* master: (129 commits) bpo-43452: Micro-optimizations to PyType_Lookup (pythonGH-24804) bpo-43517: Fix false positive in detection of circular imports (python#24895) bpo-43494: Make some minor changes to lnotab notes (pythonGH-24861) Mention that code.co_lnotab is deprecated in what's new for 3.10. (python#24902) bpo-43244: Remove symtable.h header file (pythonGH-24910) bpo-43466: Add --with-openssl-rpath configure option (pythonGH-24820) Fix a typo in c-analyzer (pythonGH-24468) bpo-41561: Add workaround for Ubuntu's custom security level (pythonGH-24915) bpo-43521: Allow ast.unparse with empty sets and NaN (pythonGH-24897) bpo-43244: Remove the PyAST_Validate() function (pythonGH-24911) bpo-43541: Fix PyEval_EvalCodeEx() regression (pythonGH-24918) bpo-43244: Fix test_peg_generators on Windows (pythonGH-24913) bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (pythonGH-18011) bpo-43244: Fix test_peg_generator for PyAST_Validate() (pythonGH-24912) bpo-42128: Add 'missing :' syntax error message to match statements (pythonGH-24733) bpo-43244: Add pycore_ast.h header file (pythonGH-24908) bpo-43244: Rename pycore_ast.h to pycore_ast_state.h (pythonGH-24907) Remove unnecessary imports in the grammar parser (pythonGH-24904) bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (pythonGH-24843) Add PEP 626 to what's new in 3.10. (python#24892) ...
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.