Skip to content

Nested dicts as input? #20

@chasehensel

Description

@chasehensel

I am really enjoying using this. I've been trying to get parsing of nested maps to work, but somehow the inner dicts loose their "mapness" and as a result can't be index.

Think input like:

x = {args : {"a" : {
"b" : "c"
}
}}

as input to the env. x is a starlark.StringDict, and accessing x works fine inside of starlark.

args is a perfectly valid command.
args["a"] also works, but args["a"]["b"] throws a runtime exception of:

Error: unhandled index operation starlight_interface<map[string]interface {}>[string]

Curious if you ever solved this?

In general, I've been playing around with some additional wrappers on top of FromValue and ToValue in order to make them work recursively -- the use case is getting json in and out of starlark. My from value recursion works really well, but I'm struggling with ToValue and figured I'd try and start a conversation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions