mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-19 15:21:26 +08:00
added _weakref mixins
This commit is contained in:
1 parent
778899af86
commit
b111c56b06
2 files changed
+21
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
def proxy(object, callback=None):
|
||||||
|
return object
|
||||||
|
|
||||||
|
class ref():
|
||||||
|
def __init__(self, object, callback=None):
|
||||||
|
self.__object = object
|
||||||
|
def __call__(self):
|
||||||
|
return self.__object
|
||||||
@@ -18,3 +18,16 @@ next(re.finditer('a', 'a')).start()
|
|||||||
|
|
||||||
#? str()
|
#? str()
|
||||||
re.sub('a', 'a')
|
re.sub('a', 'a')
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# ref
|
||||||
|
# -----------------
|
||||||
|
import weakref
|
||||||
|
|
||||||
|
#? int()
|
||||||
|
weakref.proxy(1)
|
||||||
|
|
||||||
|
#? weakref.ref
|
||||||
|
weakref.ref(1)
|
||||||
|
#? int()
|
||||||
|
weakref.ref(1)()
|
||||||
Reference in new issue
Block a user