Module weakref :: Class KeyedRef
[hide private]
[frames] | no frames]

Class KeyedRef

   object --+    
            |    
ReferenceType --+
                |
               KeyedRef

Specialized reference that includes a key corresponding to the value.

This is used in the WeakValueDictionary to avoid having to create a function object for each key stored in the mapping. A shared callback object can use the 'key' attribute of a KeyedRef instead of getting a reference to the key from an enclosing scope.

Instance Methods [hide private]
 
__init__(self, ob, callback, key)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Inherited from ReferenceType: __call__, __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __repr__

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(type, ob, callback, key)
Properties [hide private]
  key

Inherited from object: __class__

Method Details [hide private]

__new__(type, ob, callback, key)
Static Method

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__init__(self, ob, callback, key)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)