New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code refactoring/denesting for core.py #521
Conversation
@ptmcg Since you insisted on not replacing |
I am actually very appreciative of this effort on your part. Go ahead and do refactoring as you feel justified, just please keep running the unit tests to verify you haven't introduced a regression, and be mindful of parse-time performance (which is sometimes the rationale for inlining code instead of calling a function - function call overhead is high in Python, especially in a deeply recursive code like pyparsing. |
This is an enourmous PR. I'm going to go through change-by-change and mark each as accepted/rework/rejected.
|
return self | ||
|
||
def ignore(self, other) -> ParserElement: | ||
if isinstance(other, Suppress): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not if isinstance(other, Suppress) and other not in self.ignoreExprs:
? Negative logic looks weird to me here.
This PR is a part of #519.