Ejemplo n.º 1
0
 def __get__(self, obj, owner):
     if obj is None:
         return self
     try:
         return self.thread_local.__dict__[id(obj)]
     except KeyError:
         self.thread_local.__dict__[weakobjectid(obj, discarder(self.thread_local.__dict__))] = instance = self.type(*self.args, **self.kw)
         return instance
 def __set__(self, obj, value):
     self.thread_local.__dict__[weakobjectid(
         obj, discarder(self.thread_local.__dict__))] = value
Ejemplo n.º 3
0
 def __set__(self, instance, value):
     self.thread_local.__dict__[weakobjectid(
         instance, discarder(self.thread_local.__dict__))] = value
Ejemplo n.º 4
0
 def __set__(self, obj, value):
     self.thread_local.__dict__[weakobjectid(obj, discarder(self.thread_local.__dict__))] = value