why in returns values for array and keys for dictionary

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Aug 26 06:53:44 EDT 2008


"++imanshu:
>     Wouldn't it be nicer to have 'in' return values (or keys) for both
> arrays and dictionaries. Arrays and Dictionaries looked so similar in
> Python until I learned this difference.

D language works like you say, and it's awful. With a key you can find
its value, but given only the value you can't find its key.

Bye,
bearophile



More information about the Python-list mailing list