#!/usr/local/bin/python3 from threading import local class C(object): a = 1 l = local() def __init__(self): self.l.d = {} C().l.d[1] = 1 print(C.l.__dict__)