-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Cumbersome to pass curly brackets to field converters #2062
Comments
Perhaps we could support escaping curly brackets by doubling them ( |
I like that idea, since it would be somewhat natural to python users to escape them that way. Especially since f-string has become a thing |
(It's the same |
At the time of this writing, it is cumbersome to instantiate converters with any parameter containing curly brackets in its expression.
For instance, the following attempt to validate color to be one of
"red"
,"green"
or"blue"
... fails with the following
ValueError: Field names must be valid identifiers (""red", "green", "blue"" is not valid)
.One could easily work around the problem in this contrived example by using a list or tuple instead of the set literal, but what if we need curly brackets in a regex, or need to pass a
dict
?The text was updated successfully, but these errors were encountered: