This is trimmed-down example code, taken from something I was trying to implement. The excessive attribute assignments are there to represent all the steps the original code was trying to perform.
This code fails at runtime with the following error:
If you flip the comments around so that CB_ADDR is instead a string literal, the code works.
I would think that the dictionary construct should work in this context. If it should not work, or cannot be made to work, then I would request that a better error message be displayed (with line numbers) to the user.