mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-11 23:25:22 +00:00
Fix comment
This commit is contained in:
parent
d83e3ee8cd
commit
c157dff454
1 changed files with 3 additions and 2 deletions
|
@ -241,8 +241,9 @@ class StructVisitor(TypeInfoEmitVisitor):
|
||||||
if fieldtype and fieldtype.boxed and (not (parent.product or field.seq) or field.opt):
|
if fieldtype and fieldtype.boxed and (not (parent.product or field.seq) or field.opt):
|
||||||
typ = f"Box<{typ}>"
|
typ = f"Box<{typ}>"
|
||||||
if field.opt or (
|
if field.opt or (
|
||||||
# Add `Option` to allow `Dict.keys` to contain `None` for dictionary unpacking
|
# When a dictionary literal contains dictionary unpacking (e.g., `{**d}`),
|
||||||
# in a dict literal.
|
# the expression to be unpacked goes in `values` with a `None` at the corresponding
|
||||||
|
# position in `keys`. To handle this, the type of `keys` needs to be `Option<Vec<T>>`.
|
||||||
constructor == "Dict" and field.name == "keys"
|
constructor == "Dict" and field.name == "keys"
|
||||||
):
|
):
|
||||||
typ = f"Option<{typ}>"
|
typ = f"Option<{typ}>"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue