| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
There was a problem hiding this comment.
Thank you, and sorry I missed this PR!
I think your approach makes sense but there's a number of small things missing in the C code, and we need good unit test coverage for the new code.
Sorry, something went wrong.
|
Thanks for taking a look!
If you had a different approach in mind, I'm happy to change it. This is what makes sense to me, but maybe it's not the best way to go about it.. I've been busy with work lately, but I'll try to add more tests to the PR in the coming days :) |
Sorry, something went wrong.
There was a problem hiding this comment.
I think this should also be documented in the ast module (a versionchanged note saying that the repr() of AST nodes now includes the values of fields) and in the What's New for 3.13. (Or 3.14 if we don't get this ready before Tuesday.)
Sorry, something went wrong.
|
I moved the tests to a separate data folder and added a CLI toggle to automatically regenerate them with ./python Lib/test/test_ast.py --snapshot-update. This is basically snapshot testing similar to how it's done in pytest for example. unittest unfortunately doesn't have this capability so it must be implemented separately in each module :/ The advantage of snapshot testing is that we don't need to write the test cases manually - both the initial tests and whenever they need to be updated. You can just run ./python Lib/test/test_ast.py --snapshot-update and compare the diff. @ambv In case you have some thoughts on this |
Sorry, something went wrong.
|
^ fixed the conflicts in tests |
Sorry, something went wrong.
There was a problem hiding this comment.
Looking pretty good!
Sorry, something went wrong.
| } | ||
|
|
||
| if (!value_repr) { | ||
| Py_DECREF(name); |
There was a problem hiding this comment.
You can DECREF name and value earlier so you don't have to repeat this. Looks like value is no longer needed after line 1602, so you could DECREF it there. name could be DECREFed after line 1623.
Sorry, something went wrong.
There was a problem hiding this comment.
Indeed, I move those DECREFs up
Sorry, something went wrong.
|
There's some CI failure that looks like something needs to be tweaked in relation to the new file. |
Sorry, something went wrong.
Thanks for pointing that out, should be fixed now :) |
Sorry, something went wrong.
|
There's some CI failures related to conversion warnings, I think there are some changes landing soon around that so I'll wait for now. |
Sorry, something went wrong.
|
Thanks @JelleZijlstra and everyone else for reviews and help on getting this done! |
Sorry, something went wrong.
Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
closes #116022
Based on the original issue the new repr() has:
Examples (output is formatted to be more readable):
Happy to take feedback :)