You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hundread of files that are properly parsed(or not) in opposite to Python 3.11.2 #66
Compilation involves further processing. Something might be valid syntactically but in later stages the compiler might reject it due to additional rules that come into play when bytecode is to be generated.
This comparison might make more sense using the rest of the implementation in RustPython whereby you can actually test compile vs compile instead of compile vs parse.
If you only care about parsing, you could re-do the test using CPython's parser.
I'll close for now, feel free to open again if I missed something or if you re-run the test with CPython's parser and you do actually find discrepancies. Thanks!
Activity
DimitrisJim commentedon May 23, 2023
Compilation involves further processing. Something might be valid syntactically but in later stages the compiler might reject it due to additional rules that come into play when bytecode is to be generated.
This comparison might make more sense using the rest of the implementation in RustPython whereby you can actually test compile vs compile instead of compile vs parse.
If you only care about parsing, you could re-do the test using CPython's parser.
I'll close for now, feel free to open again if I missed something or if you re-run the test with CPython's parser and you do actually find discrepancies. Thanks!
youknowone commentedon May 23, 2023
@DimitrisJim Because we actually have parser incompatibility, the test set looks very useful.
@qarmin Rather than py_compile, using ast will make more sense to exclude compile step
youknowone commentedon May 24, 2023
@qarmin Do you know about the license of the test set? It will be helpful if we can include it to our test suite.
qarmin commentedon May 24, 2023
This files(or minimized part of them) I took from most popular pypi libraries, so licenses are mixed.
How to parse file in python?
Chatgpt provide this solution, but don't know if this is proper
qarmin commentedon May 28, 2023
When using
ast.parse(from above example) insteadpy_compileI got different set of invalid filesOutputASTInvalid.zip
youknowone commentedon May 29, 2023
Thanks a lot! I am sorry for late response. I am also trying to make a tool to do it easier.
youknowone commentedon May 29, 2023
You can make a compatibility test like this:
http://github.com/RustPython/Parser/pull/75/files#diff-44ab11717bbf68e3aa212e22772a18520ff7c749632213defcaecacdd1f6ecaa