Rewrite assert statements, refs #12#13
Conversation
Yeah, it is not a very straight forward solution. But basically it is for adjusting comments appropriately when the initial version of the same call (e.g I don't think it is something that this refactor should worry about. Perhaps try returning
I guess it serves the same purpose, so we can use it. I don't think we need to add it in this PR. |
isidentical
left a comment
There was a problem hiding this comment.
I didn't look in detail yet, but this is impressive work (I thought the existing refactoring infrastructure wouldn't work with asserts, but from what I understand by looking at the tests it seem to work pretty well.)
One Q: There is a special mode in teyit called --show-stats, which dumps the refactor results after each run. I wonder whether we can integrate this to there, so we can see how many asserts get refactored. It is a pretty useful metric, and if you see the Teyit step in CPython run it helps us to ensure we don't make any problematic change.
This is still a WIP.
I have several questions:
get_arg_offsetsuppose to work? I am bit a lost with this approach 🙂msgpart ofassert expr, msg? Because not allself.assert*()methods support itCloses #12