Did I find the right examples for you? yes no

All Samples(13)  |  Call(8)  |  Derive(0)  |  Import(5)
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.

src/g/r/grpc-0.3-18/grpc/rpc.py   grpc(Download)
from cStringIO import StringIO
from struct import calcsize, pack, unpack
from weakref import KeyedRef, ref, WeakValueDictionary, WeakKeyDictionary
import traceback
import functools
        else:
            export_id = id(export)
        self._exports[export_id] = KeyedRef(export, self._remove, export_id)
        setattr(export, '_rpc_id_', export_id)
        return export_id

src/d/j/django-hotsauce-0.5.0/extras/libschevo/lib/schevo/store/connection.py   Django-hotsauce(Download)
from os import getpid
from time import time
from weakref import ref, KeyedRef
 
ROOT_OID = p64(0)
    def __setitem__(self, key, value):
        self.dead.discard(key)
        self.mapping[key] = KeyedRef(value, self.remove, key)
 
    def __delitem__(self, key):

src/d/j/django-hotsauce-0.5.0/extras/libdurus/durus/connection.py   Django-hotsauce(Download)
from os import getpid
from time import time
from weakref import ref, KeyedRef
import durus.storage
 
    def __setitem__(self, key, value):
        self.dead.discard(key)
        self.mapping[key] = KeyedRef(value, self.callback, key)
 
    def __delitem__(self, key):

src/s/t/storm-0.20/storm/properties.py   storm(Download)
        for attr in cls_info.attributes:
            prop = cls_info.attributes[attr]
            prop_ref = weakref.KeyedRef(prop, self._remove, None)
            pair = (attr+suffix, prop_ref)
            prop_ref.key = pair
        suffix.reverse()
        suffix = ".%s." % ".".join(suffix)
        prop_ref = weakref.KeyedRef(prop, self._remove, None)
        pair = (attr_name+suffix, prop_ref)
        prop_ref.key = pair

src/s/c/schevo-HEAD/schevo/store/connection.py   schevo(Download)
from os import getpid
from time import time
from weakref import ref, KeyedRef
 
ROOT_OID = p64(0)
    def __setitem__(self, key, value):
        self.dead.discard(key)
        self.mapping[key] = KeyedRef(value, self.remove, key)
 
    def __delitem__(self, key):

src/d/u/Durus-3.9/connection.py   Durus(Download)
from os import getpid
from time import time
from weakref import ref, KeyedRef
import durus.storage
 
    def __setitem__(self, key, value):
        self.dead.discard(key)
        self.mapping[key] = KeyedRef(value, self.callback, key)
 
    def __delitem__(self, key):

src/n/o/norm-HEAD/norm/orm/base.py   norm(Download)
    def __setitem__(self, key, value):
        wr = weakref.KeyedRef(key, self._remove, id(key))
        self.data[id(key)] = (wr, value)
 
    def __contains__(self, key):