mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Change FormattedString's end field to a Literal
I noticed this while working on the documentation. I think this predated pyre's Literal support. I only did this for `end` and not `start`, because there's a large combinatorial set of valid `start` values. If we wanted to better type `start`, we should probably first separate the prefix from the opening quotes.
This commit is contained in:
parent
647ef53f0e
commit
ff9ed2e8e4
2 changed files with 1 additions and 7 deletions
|
|
@ -763,7 +763,7 @@ class FormattedString(_BasePrefixedString):
|
|||
start: str = 'f"'
|
||||
|
||||
#: The trailing quote. This must match the type of quote used in ``start``.
|
||||
end: str = '"'
|
||||
end: Literal['"', "'", '"""', "'''"] = '"'
|
||||
|
||||
lpar: Sequence[LeftParen] = ()
|
||||
#: Sequence of parenthesis for precidence dictation.
|
||||
|
|
|
|||
|
|
@ -839,12 +839,6 @@ class AtomTest(CSTNodeTest):
|
|||
),
|
||||
"expected_re": "must have matching enclosing quotes",
|
||||
},
|
||||
{
|
||||
"get_node": (
|
||||
lambda: cst.FormattedString(start="f'''", parts=(), end="''")
|
||||
),
|
||||
"expected_re": "must have matching enclosing quotes",
|
||||
},
|
||||
{
|
||||
"get_node": (
|
||||
lambda: cst.ConcatenatedString(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue