creating an empty dictionary inside another dictionary

Feb 11, 2014 at 6:44am

creating an empty dictionary inside another dictionary

I have a dictionary. It will contain a list of more dictionaries, which themselves will contain key value pairs.

I’d like to create the subdictionary first, then create the key value pairs.

But so far I can only see how to create a subdictionary with something in it. So I create it with a temporary dummy item, which I immediately remove. See this example:

<code>

– Pasted Max Patch, click to expand. –

</code>

Is there a way to create an empty subdictionary directly?

#280724

You must be logged in to reply to this topic.