Simply put, why do this work:
class A:
x = {'a': 'b', 'c': 'd'}
y = ", ".join([f"{key}: {val}" for key, val in x.items()])
yet this doesn't:
class A:
x = {'a': 'b', 'c': 'd'}
y = ", ".join([f"{key}: {x[key]}" for key in x])
Both work outside the class definition, so I'm not sure what's the interaction with the f-strings.