Did I find the right examples for you? yes no

All Samples(1761)  |  Call(1471)  |  Derive(0)  |  Import(290)
proxy(object[, callback]) -- create a proxy object that weakly
references 'object'.  'callback', if given, is called with a
reference to the proxy when 'object' is about to be finalized.

src/g/a/gae-twitter-oauth-example-HEAD/jinja2/loaders.py   gae-twitter-oauth-example(Download)
        mod.__path__ = path
 
        sys.modules[package_name] = weakref.proxy(mod,
            lambda x: sys.modules.pop(package_name, None))
 

src/w/e/webapp2_example-HEAD/lib/jinja2/loaders.py   webapp2_example(Download)
        mod.__path__ = path
 
        sys.modules[package_name] = weakref.proxy(mod,
            lambda x: sys.modules.pop(package_name, None))
 

src/a/c/activepapers-python-HEAD/examples/test_internal_files.py   activepapers-python(Download)
import time
from array import array
from weakref import proxy
try:
    import threading
    def testWeakRefs(self):
        # verify weak references
        p = proxy(self.f)
        p.write('teststring')
        self.assertEqual(self.f.tell(), p.tell())

src/d/i/dill-HEAD/dill/_objects.py   dill(Download)
a['ReferenceType'] = weakref.ref(_instance)
a['DeadReferenceType'] = weakref.ref(_class())
a['ProxyType'] = weakref.proxy(_instance)
a['DeadProxyType'] = weakref.proxy(_class())
a['CallableProxyType'] = weakref.proxy(_instance2)
a['DeadCallableProxyType'] = weakref.proxy(_class2())

src/d/i/dill-0.2b1/dill/dill.py   dill(Download)
def _create_weakproxy(obj, callable=False, *args):
    from weakref import proxy
    if obj is None: # it's dead
        if callable: return proxy(lambda x:x, *args)
        if PYTHON3:
            from collections import UserDict
        else:
            from UserDict import UserDict
        return proxy(UserDict(), *args)
    return proxy(obj, *args)

src/d/i/dill-HEAD/dill/dill.py   dill(Download)
def _create_weakproxy(obj, callable=False, *args):
    from weakref import proxy
    if obj is None: # it's dead
        if callable: return proxy(lambda x:x, *args)
        if PY3:
            from collections import UserDict
        else:
            from UserDict import UserDict
        return proxy(UserDict(), *args)
    return proxy(obj, *args)

src/d/i/dill-0.2b1/dill/_objects.py   dill(Download)
a['ReferenceType'] = weakref.ref(_instance)
a['DeadReferenceType'] = weakref.ref(_class())
a['ProxyType'] = weakref.proxy(_instance)
a['DeadProxyType'] = weakref.proxy(_class())
a['CallableProxyType'] = weakref.proxy(_instance2)
a['DeadCallableProxyType'] = weakref.proxy(_class2())

src/t/a/taurus-3.2.0/lib/taurus/qt/qtcore/communication/communication.py   taurus(Download)
            return None
        dm = self.__getDataModel(dataUID)
        return weakref.proxy(dm,callback)
 
    def connectReader(self, dataUID, slot, readOnConnect=True):

src/m/3/M30W-0.2.3/M30W/GUI/spritePanel.py   M30W(Download)
 
from collections import OrderedDict
from weakref import WeakKeyDictionary, proxy
import wx, dialogs
from M30W.debug import debug, not_implemented
    def __init__(self, parent, sprite):
        super(SpriteViewer, self).__init__(parent)
        self.sprite = proxy(sprite, lambda proxy: self.Destroy())
 
        self.listCtrl = EditableListCtrl(self, style=wx.LC_REPORT |

src/p/y/pymca-HEAD/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py   pymca(Download)
                    self.clear()
                return
            refProxy = weakref.proxy(phynxFile, phynxFileInstanceDistroyed)
            self.rootItem.appendChild(refProxy)
        else:
                    self.clear()
                return
            phynxFileProxy = weakref.proxy(phynxFile, phynxFileInstanceDistroyed)
            self.rootItem.appendChild(phynxFileProxy)
        else:

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next