Although dictionaries can handle keys of any type, they are optimized to use names as keys. The performance penalty for other key types is slight, but can be exacerbated by the cost of comparison for other types. Name comparison is a constant time operation, but string comparison is not. Therefore, use names rather than strings whenever possible.