Show More
Commit Description:
Merge pull request #17 from nattee/master...
Commit Description:
Merge pull request #17 from nattee/master
upgrade to current working snapshot
References:
File last commit:
Show/Diff file:
Action:
lib/assets/Lib/_weakref.py
| 33 lines
| 615 B
| text/x-python
| PythonLexer
|
r584 | class ProxyType: | |||
def __init__(self,obj): | ||||
self.obj = obj | ||||
CallableProxyType = ProxyType | ||||
ProxyTypes = [ProxyType,CallableProxyType] | ||||
class ReferenceType: | ||||
def __init__(self,obj,callback): | ||||
self.obj = obj | ||||
self.callback = callback | ||||
class ref: | ||||
def __init__(self,obj,callback=None): | ||||
self.obj = ReferenceType(obj,callback) | ||||
self.callback=callback | ||||
def __call__(self): | ||||
return self.obj.obj | ||||
def getweakrefcount(obj): | ||||
return 1 | ||||
def getweakrefs(obj): | ||||
return obj | ||||
def proxy(obj,callback=None): | ||||
return ProxyType(obj) | ||||