In case you are still confused, we can simplify the whole process by
eliminating the unnecessary use of an external module.
blank = {}
feeds = {}
feeds['a'] = blank
feeds['a'][1] = "Hello"
print(blank)
# will print {1: 'Hello'}
We can see that the dict named "blank" and the dict named "feeds['a']"
are actually the same dict:
print(feeds['a'] is blank) # Not the same as == (equals).
In case you still need more evidence:
feeds['b'] = blank
feeds['b'][1] = "Goodbye"
print(blank)
print(feeds)
will print:
{1: 'Goodbye'}
{'a': {1: 'Goodbye'}, 'b': {1: 'Goodbye'}}
(possibly the a and the b will be swapped around).
--
Steven
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor