gh-108095: Add re.grep module by serhiy-storchaka · Pull Request #108096 · python/cpython · GitHub
Skip to content

gh-108095: Add re.grep module#108096

Draft
serhiy-storchaka wants to merge 4 commits intopython:mainfrom
serhiy-storchaka:re-grep
Draft

gh-108095: Add re.grep module#108096
serhiy-storchaka wants to merge 4 commits intopython:mainfrom
serhiy-storchaka:re-grep

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented Aug 17, 2023

@serhiy-storchaka
Copy link
Copy Markdown
Member Author

Comment thread Lib/re/grep.py
return [line.removesuffix('\n') for line in f.readlines()]

def main():
parser = argparse.ArgumentParser(add_help=False)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of code for one function. I would put the parser code in a separate function, say 'grep_parser' and replace opts = parser.parse_args() below with opts = grep_parser()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong in the quoting. I only wanted the last line included.

@github-actions
Copy link
Copy Markdown

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants