I have troubles building a class manually in newer versions of Python.
class A:
x = 13
print(locals())
print(A.x)
def f():
__module__ = '__main__'
__qualname__ = 'B'
x = 13
print(locals())
B = __build_class__(f, 'B')
print(hasattr(B, 'x'))
# just for debugging
import inspect
import dis
dis.dis(inspect.currentframe().f_code)
The bytecode seems mostly the same, but B class has no attribute x at the end. Am I missing something? In older versions I only had to return a dictionary, but it has changed apparently.