Skip to content

Accept ' ' as a valid format specifier name #2079

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

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

ddfisher
Copy link
Collaborator

@ddfisher ddfisher commented Sep 1, 2016

Fix #2058.

@@ -70,7 +70,7 @@ def check_str_interpolation(self, str: StrExpr, replacements: Node) -> Type:
return self.named_type('builtins.str')

def parse_conversion_specifiers(self, format: str) -> List[ConversionSpecifier]:
key_regex = r'(\((\w*)\))?' # (optional) parenthesised sequence of characters
key_regex = r'(\(([\w ]*)\))?' # (optional) parenthesised sequence of characters
Copy link
Member

Choose a reason for hiding this comment

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

Why not "anything except parentheses"? What does Python itself implement or document?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The documentation doesn't specifically discuss this, but I tested all ASCII characters and everything except parentheses worked. I'll fix this up.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to just change it. >_>
7c76609

@gvanrossum gvanrossum merged commit 74b59d4 into master Sep 2, 2016
@ddfisher ddfisher deleted the space-format-specifier branch September 2, 2016 18:42
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