small dict change to improve py3 compatibility (also faster)

This syntax is compatible with both py2 and py3, and it's also faster.