I am getting a syntax error while trying to index a python dict:
(Pdb) o_model.flows
{(<oemof.solph.network.Bus object at 0x7f3e9c6b3ea8>, <oemof.solph.network.Transformer object at 0x7f3e9c52ce08>): <oemof.solph.network.Flow object at 0x7f3e9c50d5f8>}
Here is the key of the dict.:
(Pdb) o_model.flows.keys()
dict_keys([(<oemof.solph.network.Bus object at 0x7f3e9c6b3ea8>, <oemof.solph.network.Transformer object at 0x7f3e9c52ce08>)])
So what I am assuming is the key of the dict is (<oemof.solph.network.Bus object at 0x7f3e9c6b3ea8>, <oemof.solph.network.Transformer object at 0x7f3e9c52ce08>)
Problem is that I get an syntax error, while trying to index the o_model.flows
with the key, which is mentioned above.
Normally I was expecting to get the value(<oemof.solph.network.Flow object at 0x7f3e9c50d5f8>
) of the dict via, but instead I get an syntax error:
(Pdb) o_model.flows[(<oemof.solph.network.Bus object at 0x7f3e9c6b3ea8>, <oemof.solph.network.Transformer object at 0x7f3e9c52ce08>)]
*** SyntaxError: invalid syntax
What I do wrong?
Some Extras:
(Pdb) type(o_model.flows)
<class 'dict'>