mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35: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):
|
||||
typ = f"Box<{typ}>"
|
||||
if field.opt or (
|
||||
# Add `Option` to allow `Dict.keys` to contain `None` for dictionary unpacking
|
||||
# in a dict literal.
|
||||
# When a dictionary literal contains dictionary unpacking (e.g., `{**d}`),
|
||||
# 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"
|
||||
):
|
||||
typ = f"Option<{typ}>"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue