-
Notifications
You must be signed in to change notification settings - Fork 23
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
Literal values "and" and "or" cause ParserSyntaxError #124
Comments
I have encountered this as well with three other values of
|
X-Ref: #115 |
This is not a bug on I think we can improve the error message here. :) |
Breaks on "in" as well. from typing import Literal
from pydantic import BaseModel
class Thing(BaseModel):
value: Literal["in"]
|
I don't need more examples :) It breaks on every literal that is a reserved keyword. |
First, is there an issue open with LibCST? Maybe Instagram/LibCST#924? From the way you describe it @Kludex it sounds as if it's only reserved keywords that are failing, in which case I'd ask what reserved keywords are |
Ah... Well... On this repository, it doesn't matter what the issue really is on LibCST. You can ask on their repository. I'm interested in giving a better error message pointing out that LibCST couldn't parse the code. |
In case of I've improved the error message on #128. |
also breaks on literals containing spaces |
WorkaroundComment out all offending |
Using the string value "and" or "or" for
Literal
causes a ParserSyntaxErrorThe text was updated successfully, but these errors were encountered: