Python Naming Conventions for Dictionaries/Maps/Hashes
Posted
by pokstad
on Stack Overflow
See other posts from Stack Overflow
or by pokstad
Published on 2010-03-09T00:58:38Z
Indexed on
2010/03/09
1:06 UTC
Read the original article
Hit count: 691
While other questions have tackled the broader category of sequences and modules, I ask this very specific question:
"What naming convention do you use for dictionaries and why?"
Some naming convention samples I have been considering:
# 'value' is the data type stored in the map, while 'key' is the type of key
value_for_key={key1:value1, key2,value2}
value_key={key1:value1, key2,value2}
v_value_k_key={key1:value1, key2,value2}
Don't bother answering the 'why' with "because my work tells me to", not very helpful. The reason driving the choice is more important. Are there any other good considerations for a dictionary naming convention aside from readability?
© Stack Overflow or respective owner