Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Properly strip types that come before a [ - #16139

Open
tbuzzelli wants to merge 6 commits into
python:masterfrom
tbuzzelli:patch-1
Open

Properly strip types that come before a [#16139
tbuzzelli wants to merge 6 commits into
python:masterfrom
tbuzzelli:patch-1

Conversation

@tbuzzelli

Copy link
Copy Markdown

Fixes #16138

The improvements in #14564 updated the regex replace to make sure the surrounding characters were part of the separating characters (], ,, ). However, [ was omitted. This results in the subtype preceding the [ from not properly being replaced.

This PR adds [ to the list of characters after the type in the regex replacement and allows proper replacement of the type.

@tbuzzelli
tbuzzelli marked this pull request as ready for review September 18, 2023 19:16

@sobolevn sobolevn left a comment

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.

Thanks! But, we would need a test for this change. Looks like this is quite easy to break again in the future :(

@tbuzzelli

Copy link
Copy Markdown
Author

Thanks! But, we would need a test for this change. Looks like this is quite easy to break again in the future :(

Added a unit test that covers this.

@tbuzzelli
tbuzzelli requested a review from sobolevn September 21, 2023 21:50
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.

strip_or_import no longer fixes types of the form "module.foo[str,str]"

2 participants