From c157dff45447d90b2bc1fa902dda3ce8f6a0b28e 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 a18ec65..b217e62 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}>"