From f2ffe12f8ca5759fdb6206fb4de7074a405ab5e2 Mon Sep 17 00:00:00 2001 From: harupy Date: Sun, 22 Jan 2023 00:06:52 +0900 Subject: [PATCH] Fix comment --- ast/asdl_rs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ast/asdl_rs.py b/ast/asdl_rs.py index a18ec651e5..b217e629a7 100755 --- a/ast/asdl_rs.py +++ b/ast/asdl_rs.py @@ -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>`. constructor == "Dict" and field.name == "keys" ): typ = f"Option<{typ}>"