Dictionary

22 views
Skip to first unread message

Renato Lenzi

unread,
Apr 18, 2012, 8:52:51 AM4/18/12
to falc...@googlegroups.com
This code works:
dict = [1 => 1, 1 => 2, 1 => 3]

Ok, but, is not this a bit dangerous? That is, having multiple
identical keys within a dictionary is really good?


Thx.

Giancarlo Niccolai

unread,
Apr 18, 2012, 8:58:46 AM4/18/12
to falc...@googlegroups.com
Suppose

dict [a=>1, b => 2, c =>3]

where, in some programs
a = "one"
b= "two"
c ="three"

and in other runs
a = "one"
b = "two"
c = "one"

However, we cound raise an error for the static declaration as

dict = [1 => 1, 1 => 2, 1 => 3]

That really seems a writer's error.

Gian.

Reply all
Reply to author
Forward
0 new messages