Earlier today I asked a question about passing dictionary values to a function. While I understand now how to accomplish what I was trying to accomplish the why question (which was not asked) was never answered. So my follow up is why can't I
def myFunction(newDict['bubba']):
some code to process the parameter
Is it simply because the parser rules do not allow this? I Googled for +Python +function +"allowable parameters" and did not find anything useful so I would appreciate any information.
I am oversimplifying what is going on. I have a dictionary that is structured like
myDict={outerkey1:(innerkey1:value,innerkey2:value,. . .innerkeyn:value),outerkey2:(innerkey1:value,innerkey2:value,. . .innerkeyn:value),. . .}
As I said, I know how to do what I wanted-I got a very helpful answer. But I started wondering why
def myFunction(outerkey,myDict[outerkey]):
gives a syntax error which finely it occurred to me that it has to be a parsing problem.