Skip to content

[mypyc] Use mypy.FORMAT_RE and ConversionSpecifier for % interpolation - #10877

Merged
JukkaL merged 22 commits into
python:masterfrom
97littleleaf11:tokenizer-for-str-format
Jul 29, 2021
Merged

JukkaL merged 22 commits into
python:masterfrom
97littleleaf11:tokenizer-for-str-format

Conversation

@97littleleaf11

Copy link
Copy Markdown
Collaborator

Description

mypy.checkstrformat offers regex and ConversionSpecifier for tokenizer, thus this PR:

  • deletes the redundant code
  • uses ConversionSpecifier as FormatOp

@97littleleaf11

97littleleaf11 commented Jul 27, 2021 •

Copy link
Copy Markdown
Collaborator Author

The failure is caused by m.group. #9611 (comment). We can quickly fix this pr once #9611 (comment) is merged,

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, just one minor comment. Reusing the regular expression used for matching conversion specifiers reduces code duplication and makes it more likely that we parse format strings consistently now and in the future.

Comment thread mypy/checkstrformat.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants