7
>>> x = 'foo'
>>> {0: locals().get('x')}
{0: 'foo'}
>>> {0: locals().get('x' + spam) for spam in ['']}
{0: None}
Was ist der Grund für diese Diskrepanz im Verhalten?Python-Scoping im Diktat-Verständnis