Message 174534 - Python tracker (original) (raw)
This could be avoided by
lives_in_init = (('lion': ['Africa', 'America']), ('lion': ['Europe'])) lives_in = {} for k, v in lives_in_init: assert k not in lives_in lives_in[k] = v del lives_in_init
Which is fast enough if executed only during module-loading